I would like a query that would return the count of records that have their start-end time in specific time interval (eg. 30 mins).
For example records:
id|start|end 1|10:00|12:00 2|11:00|12:20 3|10:15|10:45
would result in
10:00-10:30|2x (records 1 and 3) 10:30-11:00|3x (all) 11:00-11:30|2x (records 1 and 2) 11:30-12:00|2x (records 1 and 2) 12:00-12:30|1x (record 2)
Usage: If I have for example 3 private instructors; I can't have more than 3 clients, meaning (in the example above) I can't appoint anybody from 10:30-11:00 as all 3 instructors are already occupied.