Re: Any function for calculating inersect of intervals?

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

Thank you Tom.

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Monday, January 17, 2005 5:37 PM
To: Együd Csaba
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Any function for calculating inersect of intervals?

=?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

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 2005.01.16.

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 2005.01.16.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 2005.01.16.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 2005.01.16.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Együd Csaba (Freemail) 2005-01-17 17:02:08 Re: Any function for calculating inersect of intervals?
Previous Message Michael Fuhr 2005-01-17 16:58:37 Re: PQexecParams and CURSOR