From: | "Dann Corbit" <DCorbit(at)connx(dot)com> |
---|---|
To: | "Anderson dos Santos Donda" <andersondonda(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: SELECT on a table with Time values |
Date: | 2009-02-04 20:15:20 |
Message-ID: | D425483C2C5C9F49B5B7A41F8944154702961FA1@postal.corporate.connx.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Anderson dos
Santos Donda
Sent: Wednesday, February 04, 2009 12:05 PM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] SELECT on a table with Time values
Hi all!!
I have a simple table with two column. The first column is a time type
and the other is a integer type. This table have datas from each minute
of day.
Example : 15:00:00, 15:01:00, 15:02:00 etc...
I want a SELECT command wich return for me the datas from each five
minutes of day.
Example: 15:00:00, 15:05:00, 15:10:00, 15:15:00 etc
There is a way to do this?
>>
How about:
SELECT integer_column, timestamp_column FROM my_table
WHERE EXTRACT(MINUTE FROM timestamp_column) % 5 = 0
<<
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Huxton | 2009-02-04 20:28:23 | Re: case sensitive db name? |
Previous Message | Anderson dos Santos Donda | 2009-02-04 20:05:10 | SELECT on a table with Time values |