ERROR | 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. |