From: Edward Macnaghten <eddy@edlsystems.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Recursive Queries
Date: Thu, 16 Apr 2020 14:45:53 +0100
Message-ID: <fa3c65cc-4547-9131-6e41-de027664567e@edlsystems.com> (raw)
In-Reply-To: <d2bc6809-520d-5525-c264-a123cb9aa57e@edlsystems.com>
References: <CA+cR4zeUtkNWMx_PBRyOv+Qg_Pxt6sbJbwKv78tGetCoPVBTbw@mail.gmail.com>
<d2bc6809-520d-5525-c264-a123cb9aa57e@edlsystems.com>
On 16/04/2020 14:36, Edward Macnaghten wrote:
> 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.
SELECT hour, SUM(CASE(WHEN date = date THEN 1 ELSE 0 END)), ...., ...
WHERE whatever
GROUP BY hour
Could be your friend
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: eddy@edlsystems.com
Subject: Re: Recursive Queries
In-Reply-To: <fa3c65cc-4547-9131-6e41-de027664567e@edlsystems.com>
References: <CA+cR4zeUtkNWMx_PBRyOv+Qg_Pxt6sbJbwKv78tGetCoPVBTbw@mail.gmail.com> <d2bc6809-520d-5525-c264-a123cb9aa57e@edlsystems.com> <fa3c65cc-4547-9131-6e41-de027664567e@edlsystems.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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