clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 818558 fiddles created (9199 in the last week).

CREATE TABLE mytable( Event INTEGER NOT NULL PRIMARY KEY ,Start_Time TIME NOT NULL ,End_Time TIME NOT NULL ); INSERT INTO mytable(Event,Start_Time,End_Time) VALUES (1,'12:03','14:20'); INSERT INTO mytable(Event,Start_Time,End_Time) VALUES (2,'12:30','12:50'); INSERT INTO mytable(Event,Start_Time,End_Time) VALUES (3,'13:05','14:45'); INSERT INTO mytable(Event,Start_Time,End_Time) VALUES (4,'14:01','14:49');
 hidden batch(es)


select hr, sum(sum(cnt)) over(order by hr) cnt from ( select hour(start_time) hr, 1 cnt from mytable union all select hour(end_time) + 1, -1 from mytable ) t group by hr
hr cnt
12 2
13 2
14 3
15 0
 hidden batch(es)