Re: Select .. Having vs computer fields

Поиск
Список
Период
Сортировка
От Francisco Reyes
Тема Re: Select .. Having vs computer fields
Дата
Msg-id 20011213101235.I43458-100000@zoraida.natserv.net
обсуждение исходный текст
Ответ на Re: Select .. Having vs computer fields  (Javier Dussaillant <ashkar@vrweb.cl>)
Список pgsql-general
On Wed, 12 Dec 2001, Javier Dussaillant wrote:

> At 12:54 PM 12/12/2001 -0500, Francisco Reyes wrote:
> >Can use use computed fields on the "having" part of select?
> >I have tried:
> >select a,b, count(*) as dups_count from some_table having dups_count > 1;
> >
> >and it gives me the error "Attribute 'dups_count' not found"
>
> You have to GROUP BY in order to use HAVING. For example:
>
> SELECT a,b, count(*) as dups_count FROM some_table GROUP BY a,b HAVING
> dups_count > 1;

My mistake for not including it in the example. I did use Group By.


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

Предыдущее
От: wsheldah@lexmark.com
Дата:
Сообщение: Re: slow queries on large syslog table
Следующее
От: Antonio Fiol Bonnín
Дата:
Сообщение: Re: slow queries on large syslog table