New question

Question:

Date: 18-10-2022 11:09:44 (In Spanish)

Como puedo ordenar una tabla de registros por fecha.[Unresolved]

La fecha esta en tipo datetime. A parte de la fecha tengo otros valores como el (el, temperatura, y humedad). Gracias.
Tags: Database - HTML - MySQL - PHP - PHP MySQLi Votes: 0 - Answers: 2 - Views: 6 Share on: Google Facebook Twitter LinkedIn Link
 

Answers:

  • Date: 22-10-2022 03:49:59 Es una producto de una consulta MySQL ... ?

    De ser asi solamente al final de la consulta, debes poner ORDER BY fecha (Si el campo datatime, se llama fecha)
      Votes: 1 - Link answer
     
  • Date: 24-05-2023 19:51:23 SELECT el, temperatura, humedad, fecha
    FROM tu_tabla
    ORDER BY fecha ASC; -- Orden ascendente (de más antiguo a más reciente)

    -- O bien

    SELECT el, temperatura, humedad, fecha
    FROM tu_tabla
    ORDER BY fecha DESC; -- Orden descendente (de más reciente a más antiguo)
      Votes: 1 - Link answer
     
To actively participate in the community first must authenticate, enter the system.Sign In
 
frjcbbae garagebible.com