From: | John McKown <jmckown(at)prodigy(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Extracting data by months |
Date: | 2000-08-03 19:23:34 |
Message-ID: | Pine.LNX.4.21.0008031416100.30765-100000@linux2.johnmckown.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
This might seem rather silly, but could you simply do something like:
select * from database
where date_field >= '01/01/2000'::date
and date_field < '02/01/2000'::date;
Of course, if date_field could contain many different years, then this
would not get you the result you wanted.
John
On Thu, 3 Aug 2000, Antti Linno wrote:
> Lo.
>
> I'm in dire need of knowledge, how to extract data by month. Monthday
> and year arent' important, those I can't give from perl script, but what
> I do give to postgres are the numbers of the months. Date field is in
> timestamp. I thought about date_trunc, but I can't think of, how to get
> data with it. In script will be 12 queries, for each month, to get the
> news from that month.
> Btw, is there somewhere a manual about date_trunc, the docs that come with
> RH6.1 distribution are somewhat short and lacking explanation of
> date_trunc.
> Antti
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-08-03 20:21:30 | Re: A question about indexes... |
Previous Message | Alexaki Sofia | 2000-08-03 17:51:44 | A question about indexes... |