Tags

links:
http://dba.stackexchange.com/questions/57445/use-of-having-without-group-by-in-sql-queries

summary:

select a, count(*) as c
from table
group by a
having c>1

is equivalent to,

select *
from (
select a, count(*) as c
from table
group by a
)
where c>1

Advertisements