From: Bruno Wolff III <bruno@wolff.to>
To: Pablo Velasquez Rivas <pvelasquez@its.co.cr>
Cc: pgsql-sql@postgresql.org
Subject: Re: About intervals
Date: Fri, 28 May 2004 16:23:54 -0500
Message-ID: <20040528212354.GB1689@wolff.to> (raw)
In-Reply-To: <40B784A9.70306@its.co.cr>
References: <40B784A9.70306@its.co.cr>
On Fri, May 28, 2004 at 12:27:53 -0600,
Pablo Velasquez Rivas <pvelasquez@its.co.cr> wrote:
>
> but if I do a query like this, I get:
> / SELECT date2 - date1 as diff FROM table WHERE date2 - date1 >=
> interval '15:00';/
> * diff
> ------
> (0 rows)
> *
> What can I do to do a query like the previous one , and get the right
> answer??
It looks like 15:00 is being taking to mean 15 hours 0 minutes.
The more normal syntax for specifying 15 minutes is '15 minutes.
So you probably want:
SELECT date2 - date1 as diff FROM table WHERE date2 - date1 >= interval
'15 minutes';
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bruno@wolff.to, pvelasquez@its.co.cr
Subject: Re: About intervals
In-Reply-To: <20040528212354.GB1689@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox