Sort registration of a MySQL query

0

I have the following table which I get from another database of a clock checker.

idemployee            fecha
    1          '2018-09-10 8:56:00'
    2          '2018-09-10 8:58:23'
    1          '2018-09-10 14:00:23'  
    1          '2018-09-10 15:58:43' 
    2          '2018-09-10 14:04:23' 
    2          '2018-09-10 15:55:00' 
    1          '2018-09-10 18:58:00' 
    2          '2018-09-10 19:00:00' 

What I want to do is sort the records in the following way per day in my front use PHP, each id "in theory" must have 4 checks per day, so I have each check to which column it belongs in my front (Input , Exit_distance, Return_distance or exit). I have a "schedule" table where I keep the time of ENTRY, EXIT_COMMENDER, RETURN_COMMUNITY and DEPARTURE in which to check.

Idemployee   Entrada    Salida_comedor   Regreso_comedor  Salia
    
asked by Ivan 22.09.2018 в 19:54
source

1 answer

0

Try this:

SELECT Idemployee,Entrada,Salida,comedor,Regreso,Salia FROM tuTabla ORDER BY fecha, Idemployee

If the columns are fictional you can do this:

"ValorPorDefecto" as NombreColumna

    
answered by 22.09.2018 в 20:13