Re: A join of 2 tables with sum(column) > 30

Поиск
Список
Период
Сортировка
От Vibhor Kumar
Тема Re: A join of 2 tables with sum(column) > 30
Дата
Msg-id 66DD1CD5-0836-44D0-9B23-3AFEA83B4733@enterprisedb.com
обсуждение исходный текст
Ответ на Re: A join of 2 tables with sum(column) > 30  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
On Mar 16, 2011, at 3:15 AM, Alexander Farber wrote:

> And same for a simple select-query from1 table (w/o join):
>
> # select id from pref_match where sum(completed) > 30 group by id;
> ERROR:  aggregates not allowed in WHERE clause
> LINE 1: select id from pref_match where sum(completed) > 30 group by...
>                                        ^

 Use having clause for aggrgate function,

group by col1, col2 having sum(col) >


Thanks & Regards,
Vibhor Kumar
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
vibhor.kumar@enterprisedb.com
Blog:http://vibhork.blogspot.com


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

Предыдущее
От: Vibhor Kumar
Дата:
Сообщение: Re: A join of 2 tables with sum(column) > 30
Следующее
От: Bill Thoen
Дата:
Сообщение: Re: Partitioned Database and Choosing Subtables