getting daily stats for event counts

From: David Gauthier <davegauthierpg(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: getting daily stats for event counts
Date: 2020-06-23 16:04:50
Message-ID: CAMBRECA2_ahWXbCDxynPob7cvyjOXVPQC7aqCgscq=tXiD9B1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi:
9.6.0 on linux

I have a table which logs the inception of an event with an
"incept_datetime" (timestamptz) field. I want to know how many events
occurred per day from one date to the next using midnight as a marker for
each day reported. The end result should be something like...

2019-06-23 44
2019-06-24 18
2019-06-25 38
etc...

Is there a query that can do this ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-06-23 16:28:30 Re: getting daily stats for event counts
Previous Message Ron 2020-06-23 15:36:31 Re: UPDATE on 20 Million Records Transaction or not?