Skip to content

Fix HAVING without GROUP BY#7496

Merged
KochetovNicolai merged 1 commit intoClickHouse:masterfrom
amosbird:fix15
Oct 27, 2019
Merged

Fix HAVING without GROUP BY#7496
KochetovNicolai merged 1 commit intoClickHouse:masterfrom
amosbird:fix15

Conversation

@amosbird
Copy link
Copy Markdown
Collaborator

@amosbird amosbird commented Oct 27, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Category (leave one):

  • Improvement

Short description (up to few sentences):
Queries with HAVING and without GROUP BY assume group by constant. So, SELECT 1 HAVING 1 now returns a result.

HAVING without GROUP BY could either be treated as an error (DB2, firebird, sqlite), or returns some constant (mysql, postgres). Let's favor the latter.

@KochetovNicolai KochetovNicolai added the pr-improvement Pull request with some product improvements label Oct 27, 2019
@KochetovNicolai KochetovNicolai merged commit 43c8d13 into ClickHouse:master Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants