Suppose there is a table structured as follows:
id start end -------------------- 01 00:18 00:23 02 00:22 00:31 03 00:23 00:48 04