| From: | "Edward W(dot) Rouse" <erouse(at)comsquared(dot)com> |
|---|---|
| To: | <pgsql-sql(at)postgresql(dot)org> |
| Subject: | group by day |
| Date: | 2007-05-24 18:49:47 |
| Message-ID: | 04c201c79e34$4e3877c0$143c520a@ntc2s.comsquared.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
I have an audit table that I am trying to get a count of the number of distinct entries per day by the external table key field. I
can do a
select count(distinct(id)) from audit where timestamp >= '01-may-2007'
and get a total count. What I need is a way to group on each day and get a count per day such that the result would be something
like
date count
01-may-2007 107
02-may-2007 215
03-may-2007 96
04-may-2007 0
I would prefer the 0 entries be included but can live without them. Thanks.
Oh, postgres 7.4 by the way.
Edward W. Rouse
ComSquared Systems, Inc.
770-734-5301
| From | Date | Subject | |
|---|---|---|---|
| Next Message | A. Kretschmer | 2007-05-24 19:42:42 | Re: group by day |
| Previous Message | Rodrigo De León | 2007-05-24 18:23:25 | Re: off topic |