Oracle Error Message
PLS-00119: Duplicate having-clause in table expression
Reason for the Error
Two or more HAVING clauses were found in a SELECT statement. The HAVING clause specifies a condition under which groups of rows (formed by the GROUP BY clause) are included in the result. The condition can include several logical expressions connected by AND or OR, but a statement can contain only one HAVING clause.
Solution
Remove one of the HAVING clauses and, if necessary, connect logical expressions by AND or OR.