pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedgrouping by date
2+ messages / 2 participants
[nested] [flat]
* grouping by date
@ 2004-01-05 17:14 teknokrat <teknokrat@yahoo.com>
2004-01-09 04:59 ` Re: grouping by date Robert Creager <Robert_Creager@LogicalChaos.org>
0 siblings, 1 reply; 2+ messages in thread
From: teknokrat @ 2004-01-05 17:14 UTC (permalink / raw)
To: pgsql-sql
How can I group by date given a timestamp column?
thanks
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: grouping by date
2004-01-05 17:14 grouping by date teknokrat <teknokrat@yahoo.com>
@ 2004-01-09 04:59 ` Robert Creager <Robert_Creager@LogicalChaos.org>
0 siblings, 0 replies; 2+ messages in thread
From: Robert Creager @ 2004-01-09 04:59 UTC (permalink / raw)
To: teknokrat@yahoo.com; +Cc: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-01-09 04:59 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-05 17:14 grouping by date teknokrat <teknokrat@yahoo.com>
2004-01-09 04:59 ` Robert Creager <Robert_Creager@LogicalChaos.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox