From: | Andreas Kretschmer <akretschmer(at)despammed(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: [despammed] Re: Need clarification |
Date: | 2005-05-23 11:41:40 |
Message-ID: | 20050523114140.GG15889@webserv.wug-glas.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
am 23.05.2005, um 16:31:55 +0530 mailte palanivel(dot)kumaran(at)scandent(dot)com folgendes:
>
>
>
>
> Sorry, I didn't get ur point...please, tell me exact query to extract the
> rows from a table A which contains a date field named DTE whose difference
> is 30 days as compared to the current date...
test=# create table datediff (start date);
CREATE TABLE
test=# insert into datediff values ('1966/08/30');
INSERT 153382679 1
test=# insert into datediff values ('2005/05/23');
INSERT 153382680 1
test=# select * from datediff ;
start
------------
1966-08-30
2005-05-23
(2 Zeilen)
test=# select * from datediff where CURRENT_DATE - start > 10;
start
------------
1966-08-30
(1 Zeile)
test=# select * from datediff where CURRENT_DATE - start < 10;
start
------------
2005-05-23
(1 Zeile)
Btw.: please no TOFU, read http://en.wikipedia.org/wiki/TOFU
Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===
From | Date | Subject | |
---|---|---|---|
Next Message | Markus Bertheau | 2005-05-23 18:33:39 | ARRAY() returning NULL instead of ARRAY[] resp. {} |
Previous Message | Andreas Kretschmer | 2005-05-23 11:26:54 | Re: [despammed] need date clarification |