QSM-01060: illegal subquery in the HAVING clause Cause: When a HAVING clause has a subquery, then any references to the tables in the outer query should only reference the tables in the GROUP BY clause. Action: Correct error in the syntax and rerun the query.