SQL Language (MOSC)

MOSC Banner


HAVING clause without GROUP BY?

edited May 3, 2016 11:33AM in SQL Language (MOSC) 3 commentsAnswered


A colleague of mine sent me a query where he used a HAVING clause without a GROUP BY one, and the query works.

According to the SQL Reference manual, it should not:


Specify GROUP BY and HAVING after the where_clause and hierarchical_query_clause.

Tested on and

You can test with the following query:


FROM (select object_name, 1 dummy from user_objects)

HAVING dummy = 1;

Shouldn't there be a syntax error raised?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.


Don't have a My Oracle Support Community account? Click here to get started.

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center