Aggregates in WHERE clause?
От | Ruben Gouveia |
---|---|
Тема | Aggregates in WHERE clause? |
Дата | |
Msg-id | 51e507b0809101611x230bf7a6if0da0760108986ea@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Aggregates in WHERE clause?
Re: Aggregates in WHERE clause? Re: Aggregates in WHERE clause? |
Список | 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 по дате отправления: