Not the answer you need?
Register and ask your own question!

query for creating time range

bhishmbhishm EntrantInactive User Role Beginner
In the school different staff come at different time.

NAME | Date | INTIME | OUTIME
A | 2015-10-08 | 08:00:00 | 18:00:00
B | 2015-10-08 | 10:00:00 | 14:00:00
C | 2015-10-08 | 15:00:00 | 18:00:00

We want output like this
Date | Time Range | People Present
2015-10-08 | 08-09 | 1
2015-10-08 | 09-10 | 1
2015-10-08 | 10-11 | 2
2015-10-08 | 11-12 | 2
2015-10-08 | 12-13 | 2
2015-10-08 | 13-14 | 2
2015-10-08 | 14-15 | 3

How can we generate such an output through query.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.