Re: Aggregates in WHERE clause?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Aggregates in WHERE clause?
Дата
Msg-id 20080910161537.Q33198@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Aggregates in WHERE clause?  ("Ruben Gouveia" <rubes7202@gmail.com>)
Список pgsql-sql
On Wed, 10 Sep 2008, Ruben Gouveia wrote:

> I tried to do the following and got the following error message:
>
> select employee,count(distinct tasks)
>         from job
>         where greatest(max(last_job_date),max(last_position_date)) <
> 2008-08-28 + integer '1'
>         group by employee;
>
> ERROR:  aggregates not allowed in WHERE clause

You probably want to look at some variant with HAVING, assuming you intend
those max()s to be based on the employee groups.


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

Предыдущее
От: "Ruben Gouveia"
Дата:
Сообщение: Aggregates in WHERE clause?
Следующее
От: "Richard Broersma"
Дата:
Сообщение: Re: Aggregates in WHERE clause?