Re: We are not following the spec for HAVING without GROUP BY
| От | Greg Stark |
|---|---|
| Тема | Re: We are not following the spec for HAVING without GROUP BY |
| Дата | |
| Msg-id | 87acpc5fjh.fsf@stark.xeocode.com обсуждение исходный текст |
| Ответ на | We are not following the spec for HAVING without GROUP BY (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: We are not following the spec for HAVING without GROUP BY
|
| Список | pgsql-hackers |
Tom Lane <tgl@sss.pgh.pa.us> writes: > In particular this whole business of "moving HAVING into WHERE" is > wrong and should go away. It sort of seems like "select aggregate(col) from tab" with no GROUP BY clause is a bit of a special case. The consistent thing to do would be to return no records. It's only due to the special case that SQL returns a single record for this case. It seems like this special case is the only way to expose this difference between a WHERE clause and a HAVING clause with an aggregate-free expression. It seems like all that's needed is a simple flag on the Aggregate node that says whether to output a single record if there are no input records or to output no records. -- greg
В списке pgsql-hackers по дате отправления: