Re: limit based on count(*)

From: Russell Keane <Russell(dot)Keane(at)inps(dot)co(dot)uk>
To: Alban Hertroys <haramrae(at)gmail(dot)com>, Steve Clark <sclark(at)netwolves(dot)com>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: limit based on count(*)
Date: 2013-02-22 16:14:34
Message-ID: 8D0E5D045E36124A8F1DDDB463D548557D1618F4D4@mxsvr1.is.inps.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> select serial_no, count(*) as "restarts" from event_log where event_mesg ilike 'system sta%' and event_date > current_date - 7
> group by serial_no
> having count(*) > X
> order by restarts
I think having is the better option.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Clark 2013-02-22 16:19:02 Re: limit based on count(*)
Previous Message Adrian Klaver 2013-02-22 16:14:06 Re: Need help extripating plpgsql