Re: Any function for calculating inersect of intervals?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Együd Csaba <csegyud(at)vnet(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Any function for calculating inersect of intervals?
Date: 2005-01-17 16:37:27
Message-ID: 2547.1105979847@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?iso-8859-2?Q?Egy=FCd_Csaba?= <csegyud(at)vnet(dot)hu> writes:
> E.g. I have four dates (D1, D2, D3, D4) and I want to know if (D1,D2)
> intersects (D3,D4) or not.

See the OVERLAPS operator:
( start1, end1 ) OVERLAPS ( start2, end2 )
http://developer.postgresql.org/docs/postgres/functions-datetime.html

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2005-01-17 16:48:38 Re: Any function for calculating inersect of intervals?
Previous Message Nick Burch 2005-01-17 16:25:09 Re: What is postgresql doing for "statement: commit;begin;"