Du kan have et indre udvalg, såsom:
SELECT count_of_foo, count(bar), baz
FROM (SELECT count(foo) as count_of_foo, bar, baz, other1, other2 FROM complex_query WHERE foo = bar HAVING count(foo) > 1) inner_query
GROUP BY count_of_foo, baz.
Dette vil give dig mulighed for at tilføje flere grupper efter HAVING-sætningen.