Skip site navigation (1) Skip section navigation (2)

About intervals

From: Pablo Velasquez Rivas <pvelasquez(at)its(dot)co(dot)cr>
To: pgsql-sql(at)postgresql(dot)org
Subject: About intervals
Date: 2004-05-28 18:27:53
Message-ID: 40B784A9.70306@its.co.cr (view raw or flat)
Thread:
Lists: pgsql-sql
Hi all.
I have a table with some timestamps fields. For example this table:

*              date1        |         date2       
-----------------------------+---------------------------
 2004-03-01 11:20:00 | 2004-03-01 11:55:00*

If I do a query like this, I get:

/ SELECT date2 - date1 as diff FROM table/;
* diff 
-------
 00:35
(1 row)
*

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

Thanks !!
-- 
==                                 ==
   Pablo A. Velasquez Rivas
Computer Science Engineer
==                                 ==
/ All programmers are optimists / -- Frederick P. Brooks, Jr.

Responses

pgsql-sql by date

Next:From: Bruno Wolff IIIDate: 2004-05-28 21:23:54
Subject: Re: About intervals
Previous:From: Jared EvansDate: 2004-05-28 16:40:39
Subject: Re: not really SQL but I need info on BLOBs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group