Expected expression after 'HAVING'.
The HAVING clause in your SQL statement isn't followed by a search condition.