Re: grouping by date - Mailing list pgsql-sql

From Robert Creager
Subject Re: grouping by date
Date
Msg-id 20040108215958.791d131c.Robert_Creager@LogicalChaos.org
Whole thread Raw
In response to grouping by date  (teknokrat <teknokrat@yahoo.com>)
List pgsql-sql
When grilled further on (Mon, 05 Jan 2004 17:14:26 +0000),
teknokrat <teknokrat@yahoo.com> confessed:

> How can I group by date given a timestamp column?
> 

I just found this out this weekend.  Try 'date_trunc'.  Look at secion 9.8.2 of
the documentation.  I'm using something like:

SELECT date_trunc( 'hour', "when" ) AS "date" FROM readings GROUP BY "date";

Where "when" is my timestamp columnn.

Cheers,
Rob

-- 21:55:40 up 11 days, 11:46,  4 users,  load average: 2.09, 2.03, 2.01

pgsql-sql by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: COPY command
Next
From: Tom Lane
Date:
Subject: Re: Date select question...