Aggregates in WHERE clause?

Поиск
Список
Период
Сортировка
От Ruben Gouveia
Тема Aggregates in WHERE clause?
Дата
Msg-id 51e507b0809101611x230bf7a6if0da0760108986ea@mail.gmail.com
обсуждение исходный текст
Ответы Re: Aggregates in WHERE clause?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: Aggregates in WHERE clause?  ("Richard Broersma" <richard.broersma@gmail.com>)
Re: Aggregates in WHERE clause?  ("Igor Neyman" <ineyman@perceptron.com>)
Список pgsql-sql
<div dir="ltr">I tried to do the following and got the following error message:<br /><br /><span style="color: rgb(51,
51,255);">select employee,count(distinct tasks)</span><br style="color: rgb(51, 51, 255);" /><span style="color:
rgb(51,51, 255);">        from job</span><br style="color: rgb(51, 51, 255);" /><span style="color: rgb(51, 51,
255);">       where greatest(max(last_job_date),max(last_position_date)) < 2008-08-28 + integer '1'</span><br
style="color:rgb(51, 51, 255);" /><span style="color: rgb(51, 51, 255);">        group by employee;</span><br /><br
/><fontcolor="#cc0000">ERROR:  aggregates not allowed in WHERE clause<br /><br />********** Error **********<br /><br
/>ERROR:aggregates not allowed in WHERE clause<br />SQL state: 42803</font><br /><br />Is there away around this?
Shouldi create a function to populate a variable that can be used in it's place...will that even work?<br /><br /><br
/></div>

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

Предыдущее
От: Emi Lu
Дата:
Сообщение: pg_restore in java connection (auto_commit = false)
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Aggregates in WHERE clause?