MySQL BLOG

domingo, 17 de abril de 2022

Order a MySQL table by two columns

 


Default sorting is ascending, you need to add the keyword DESC to both your orders:

ORDER BY article_rating DESC, article_time DESC

https://stackoverflow.com/questions/514943/order-a-mysql-table-by-two-columns

$query = " select * from  users where price like '%$_GET[par]%' or  info like '%$_GET[par]%' or keyword  like '%$_GET[par]%' order by price,  id desc";

Publicado por Ambiorix Rodriguez en 20:32 No hay comentarios:
Enviar por correo electrónicoEscribe un blogCompartir en XCompartir con FacebookCompartir en Pinterest
Entradas más recientes Entradas antiguas Inicio
Suscribirse a: Entradas (Atom)

Archivo del blog

  • ►  2025 (9)
    • ►  mayo (2)
    • ►  abril (4)
    • ►  marzo (1)
    • ►  enero (2)
  • ►  2024 (14)
    • ►  diciembre (1)
    • ►  noviembre (2)
    • ►  octubre (8)
    • ►  septiembre (2)
    • ►  mayo (1)
  • ►  2023 (3)
    • ►  junio (1)
    • ►  febrero (2)
  • ▼  2022 (2)
    • ►  agosto (1)
    • ▼  abril (1)
      • Order a MySQL table by two columns
  • ►  2021 (5)
    • ►  octubre (1)
    • ►  agosto (2)
    • ►  enero (2)
  • ►  2018 (3)
    • ►  octubre (1)
    • ►  marzo (2)
  • ►  2017 (5)
    • ►  noviembre (2)
    • ►  agosto (1)
    • ►  abril (1)
    • ►  marzo (1)
  • ►  2016 (12)
    • ►  agosto (1)
    • ►  julio (1)
    • ►  junio (1)
    • ►  abril (1)
    • ►  febrero (4)
    • ►  enero (4)
  • ►  2015 (7)
    • ►  noviembre (7)
Tema Sencillo. Con la tecnología de Blogger.