Search Postgresql Archives

Re: SELECT on a table with Time values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Anderson dos Santos Donda
Sent: Wednesday, February 04, 2009 12:05 PM
To: pgsql-general@xxxxxxxxxxxxxx
Subject: 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

<< 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux