3
I would like to know how to do a select where I can display in columns the employee input and output records in the lobby.
The table looks like this:
╔════╦══════╦═════════════════════╦═════════════════════╗
║ ID ║ Nome ║ DHEntrada ║ DHSaída ║
╠════╬══════╬═════════════════════╬═════════════════════╣
║ 1 ║ João ║ 2017-02-06 11:05:22 ║ 2017-02-06 14:05:22 ║
║ 2 ║ José ║ 2017-02-06 08:05:22 ║ 2017-02-06 10:05:22 ║
║ 3 ║ João ║ 2017-02-06 08:05:22 ║ 2017-02-06 09:05:22 ║
║ 2 ║ José ║ 2017-02-05 12:05:22 ║ 2017-02-05 18:05:22 ║
║ 2 ║ José ║ 2017-02-05 08:44:22 ║ 2017-02-05 10:01:22 ║
╚════╩══════╩═════════════════════╩═════════════════════╝
The consultation would be:
╔═════╦════════════╦═══════════╦════════════╦═══════════╗
║Nome ║ Entr 05/02 ║ Saí 05/02 ║ Entr 06/02 ║ Saí 06/02 ║
╠═════╬════════════╬═══════════╬════════════╬═══════════╣
║João ║ 0 ║ 0 ║ 2 ║ 2 ║
║José ║ 2 ║ 2 ║ 1 ║ 1 ║
╚═════╩════════════╩═══════════╩════════════╩═══════════╝
Will you have the dates set or do you want everything to be created dynamically? And what does 0, 1 and 2 mean in the second table?
– Sorack
Wow!!! At the time I did not see these ASCII tables!!!
– LS_ᴅᴇᴠ
@Sorack The dates are dynamic yes. The numbers 0.1 and 2 are the incidence of input and the outgoing incidences of each element (in the case of "John" and "Joseph") on the specified dates.
– SnowBG