| From: | Justin Clift <justin(at)postgresql(dot)org> | 
|---|---|
| To: | Cefull Lo <cefull_lo(at)yahoo(dot)com>, PostgreSQL General Mailing List <pgsql-general(at)postgresql(dot)org> | 
| Subject: | Re: time interval question | 
| Date: | 2001-08-20 19:10:03 | 
| Message-ID: | 3B81608B.C0F6E141@postgresql.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Hi,
You could do something along the lines of :
SELECT foo, bar FROM baz WHERE date_part('hour', foo) > 0 AND
date_part('hour', foo) < 8;
Simple, but effective.  Only works for whole hours like in your example
though.
:-)
Regards and best wishes,
Justin Clift
Cefull Lo wrote:
> 
> given a timestamp data, e.g. 2001-08-18 06:01:23+08
> How can I check that is it lie between 00:00:00 and 08:00:00 and ignore the
> date?
> 
> --
> content-type:kiss/hug
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joseph Shraibman | 2001-08-20 19:14:31 | Re: where is PostgreSQL log ?!?! | 
| Previous Message | Denis Perchine | 2001-08-20 18:56:35 | Re: Re: Perfomance decreasing |