Re: Split daterange into sub periods

From: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Split daterange into sub periods
Date: 2018-07-05 14:16:08
Message-ID: CAMsqVxtZa_Pn4nTbjkV9q0mdd0vbtUNXLKmkngC44reJ0xuP4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In fact I'm trying to split a period in sub periods. Following this example
:
If I have a period =[2018-01-01, 2018-01-31] and two other periods
[2018-01-04, 2018-01-06] and [2018-01-08, 2018-01-08].
If I split the base period '[2018-01-01, 2018-01-31]' by the other two
periods '[2018-01-04, 2018-01-06]' and '[2018-01-08, 2018-01-08]' I will
got such a result:
[2018-01-01, 2018-01-03]
[2018-01-07, 2018-01-07]
[2018-01-09, 2018-01-31].

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2018-07-05 14:38:30 Re: Split daterange into sub periods
Previous Message David G. Johnston 2018-07-05 14:13:18 Split daterange into sub periods