clear markdown compare help donate comments/suggestions/bugs a leap of faith? diddy dollings
clear markdown donate comments/suggestions/bugs a leap of faith?
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 432115 distinct fiddles created so far.

CREATE VIEW data ( start, ende ) AS ( VALUES (TIME '18:54', TIME '18:59'), (TIME '19:15', TIME '19:24'), (TIME '20:33', TIME '20:40'), (TIME '20:47', TIME '20:53'), (TIME '23:19', TIME '23:28') );
 hidden batch(es)


SELECT start, ende, 'Arbeit' AS info FROM data UNION ALL SELECT d1.ende + INTERVAL '1 minute' AS start, d2.ende, 'Pause' FROM data AS d1, LATERAL ( SELECT start - INTERVAL '1 minute' AS ende, start - d1.ende AS diff FROM data WHERE start > d1.ende ORDER BY start LIMIT 1) AS d2 WHERE diff > INTERVAL '10 minute' ORDER BY 1
start ende info
18:54:00 18:59:00 Arbeit
19:00:00 19:14:00 Pause
19:15:00 19:24:00 Arbeit
19:25:00 20:32:00 Pause
20:33:00 20:40:00 Arbeit
20:47:00 20:53:00 Arbeit
20:54:00 23:18:00 Pause
23:19:00 23:28:00 Arbeit
 hidden batch(es)