Re: limit based on count(*)

Поиск
Список
Период
Сортировка
От Steve Clark
Тема Re: limit based on count(*)
Дата
Msg-id 51279A76.3050800@netwolves.com
обсуждение исходный текст
Ответ на Re: limit based on count(*)  (Russell Keane <Russell.Keane@inps.co.uk>)
Список pgsql-general
On 02/22/2013 11:14 AM, Russell Keane 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
>
> > having count(*) > X
>
> > order by restarts
>
> I think having is the better option.
>
Thanks all, didn't know about having - I am noobie with SQL.

--
Stephen Clark

В списке pgsql-general по дате отправления:

Предыдущее
От: Russell Keane
Дата:
Сообщение: Re: limit based on count(*)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Access a window's frame_end row from a window function