Re: limit based on count(*) - Mailing list pgsql-general

From Alban Hertroys
Subject Re: limit based on count(*)
Date
Msg-id CAF-3MvOmSQwZgE2J+_x8n10ys7sXzy26DZ1w69CTCejzcN7QCA@mail.gmail.com
Whole thread Raw
In response to limit based on count(*)  (Steve Clark <sclark@netwolves.com>)
Responses Re: limit based on count(*)
List pgsql-general
On 22 February 2013 17:01, Steve Clark <sclark@netwolves.com> wrote:

> 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 order by restarts
>


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

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Access a window's frame_end row from a window function
Next
From: Russell Keane
Date:
Subject: Re: limit based on count(*)