When a subquery statement contains a HAVING statement but no GROUP BY it is possible to automatically add the necessary GROUP BY fields using the default column(s) from the main query.
Though the query is more complex this adaptation is still simple in terms of transformations.
For this example we use the query:
"show the sales of departments with total sales higher than 20.000"
We have shortened the original query by removing the mention of SELECT Department FROM SalesOverview GROUP BY Department.