Re: Any function for calculating inersect of intervals? - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Any function for calculating inersect of intervals?
Date
Msg-id 41EBEC66.8010909@magproductions.nl
Whole thread Raw
In response to Any function for calculating inersect of intervals?  (Együd Csaba <csegyud@vnet.hu>)
Responses Re: Any function for calculating inersect of intervals?
Re: Any function for calculating inersect of intervals?
List pgsql-general
Együd Csaba wrote:
> Hi,
> wondering if exists any functions which aim to calculate intersect of two
> intervals.
> E.g. I have four dates (D1, D2, D3, D4) and I want to know if (D1,D2)
> intersects (D3,D4) or not.

Try INTERSECTS :P

SELECT * FROM table WHERE (D1, D2) INTERSECTS (D3, D4);


Related, are there any operators/functions to test for adjacency (start
of one is end of other), inclusion (interval is inside other interval)
or wrapping (the inverse; interval is around other interval) of intervals?

Alban.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Any function for calculating inersect of intervals?
Next
From: Alban Hertroys
Date:
Subject: Re: Any function for calculating inersect of intervals?