Re: Conditional return of aggregated data

From: "Ravi Krishna" <srkrishna(at)myself(dot)com>
To: n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch
Cc: postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Conditional return of aggregated data
Date: 2019-12-02 11:52:49
Message-ID: trinity-d2559a0b-faa4-465b-b2cd-1878b08feb22-1575287569190@3c-app-mailcom-lxa05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> My initial idea was something along the lines of :
> select (select sum(statcount) from stats_residence) as aggstat,statcount,short_name_en from stats_residence where aggstat>some_number;

Am I missing something basic. The above can be done using
GROUP BY and HAVING clause.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ravi Krishna 2019-12-02 11:56:58 Re: Conditional return of aggregated data
Previous Message Wim Bertels 2019-12-02 11:27:42 Re: Conditional return of aggregated data