v.19.17Improvement
Queries with HAVING and Without GROUP BY Assume Group by Constant
Queries withHAVINGand withoutGROUP BYassume group by constant. So,SELECT 1 HAVING 1now returns a result. #7496 (Amos Bird)
Why it matters
This feature addresses the limitation where queries containing aHAVING clause but lacking a GROUP BY clause would not return a result. It enhances query flexibility by allowing such queries to be executed correctly, assuming a constant group, which aligns with SQL standards and simplifies query writing.How to use it
Simply write queries with aHAVING clause without specifying a GROUP BY. For example:SELECT 1 HAVING 1This query will now return a result without needing any additional configuration.