Re: Recursive Queries

From: Edward Macnaghten <eddy(at)edlsystems(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Recursive Queries
Date: 2020-04-16 13:36:38
Message-ID: d2bc6809-520d-5525-c264-a123cb9aa57e@edlsystems.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 16/04/2020 09:35, Alex Magnum wrote:
> Hi,
> I have a simple table with singup timestamps
>
> What I would like to do is to create a table as shown below that
> displays the counts per our for the past n dates.

Various ways, but for me...

SELECT hour, SUM(CASE(WHEN date = date THEN 1 ELSE 0)), ...., ....
WHERE whatever
GROUP BY hour

could be your friend

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Olivier Gautherot 2020-04-16 13:42:44 Re: Recursive Queries
Previous Message Michael Lewis 2020-04-16 13:25:29 Re: Recursive Queries