v.19.17Improvement

Queries with HAVING and Without GROUP BY Assume Group by Constant

Queries with HAVING and without GROUP BY assume group by constant. So, SELECT 1 HAVING 1 now returns a result. #7496 (Amos Bird)
Improved support for HAVING clauses in queries without a GROUP BY clause, allowing queries like SELECT 1 HAVING 1 to return results by assuming a group by constant.

Why it matters

This feature addresses the limitation where queries containing a HAVING 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 a HAVING clause without specifying a GROUP BY. For example:
SELECT 1 HAVING 1

This query will now return a result without needing any additional configuration.