I have a problem creating some statistics for a conference where all visitors where scanned every time they entered and left the building.
I used mySQL and ‘stats’ table looks like this:
id(int) | accesscode(text) | in(datetime) | out(datetime)
And contains stats from 3 different days in the same table.
I want to get the statistics like this:
accesscode(text) first_entry(datetime) last_exit(datetime) no_of_exits(int) time_in day(int ex:1,2,3)
This will result in three entries for each accesscode defined by day.
I tried several times but actually I have no clue how to do this.
1 Answer