Re: [GENERAL] How to select where .... - Mailing list pgsql-general

From jose soares
Subject Re: [GENERAL] How to select where ....
Date
Msg-id 384BBB04.9FA114E5@sferacarta.com
Whole thread Raw
In response to How to select where ....  (Edouard DESSIOUX <edx@intrinsec.com>)
List 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 !!"
>
> ************


pgsql-general by date:

Previous
From: Silvio Macedo
Date:
Subject: JDBC / JBUILDER
Next
From: "vincent leycuras"
Date:
Subject: java and postgres