Re: About intervals - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: About intervals
Date
Msg-id 20040528212354.GB1689@wolff.to
Whole thread Raw
In response to About intervals  (Pablo Velasquez Rivas <pvelasquez@its.co.cr>)
List pgsql-sql
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';


pgsql-sql by date:

Previous
From: Pablo Velasquez Rivas
Date:
Subject: About intervals
Next
From: basic
Date:
Subject: passing new/old record in pl/pgsql trigger functions to other functions