Re: [GENERAL] How to select where ....

From: jose soares <jose(at)sferacarta(dot)com>
To: Edouard DESSIOUX <edx(at)intrinsec(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] How to select where ....
Date: 1999-12-06 13:32:52
Message-ID: 384BBB04.9FA114E5@sferacarta.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

create table truc (a datetime);
CREATE
insert into truc values(current_timestamp);
INSERT 1869961 1
insert into truc values('1999-11-25 12:30:00');
INSERT 1869962 1
select * from truc;
a
--------------------------
06/12/1999 15:28:14.00 CET
25/11/1999 12:30:00.00 CET
(2 rows)

select * from truc
where a > (current_timestamp - interval '10 days');
a
--------------------------
06/12/1999 15:28:14.00 CET
(1 row)

José

Edouard DESSIOUX ha scritto:

> Hello,
>
> I've encountered a pb while making a simple request :
> A have a field date whose type is timestamp and I would like
> to make a select like :
> select * from truc
> where date > (current_timestamp - 10 days)
>
> Anyone know how I could perform such a query
>
> Txs
>
> --
> Edouard DESSIOUX
> Proverbe chien :
> "Si ca se mange pas,
> Si ca se baise pas,
> Pisse dessus !!"
>
> ************

In response to

Browse pgsql-general by date

  From Date Subject
Next Message vincent leycuras 1999-12-06 13:44:37 java and postgres
Previous Message Silvio Macedo 1999-12-06 13:15:51 JDBC / JBUILDER