Exclude overlapping periods in time aggregate function
问题 I have a table containing each a start and and end date: DROP TABLE temp_period; CREATE TABLE public.temp_period ( id integer NOT NULL, "startDate" date, "endDate" date ); INSERT INTO temp_period(id,"startDate","endDate") VALUES(1,'2010-01-01','2010-03-31'); INSERT INTO temp_period(id,"startDate","endDate") VALUES(2,'2013-05-17','2013-07-18'); INSERT INTO temp_period(id,"startDate","endDate") VALUES(3,'2010-02-15','2010-05-31'); INSERT INTO temp_period(id,"startDate","endDate") VALUES(7,'2014