2152 HAVING specified without a GROUP BY

Advantage Error Guide

Problem: The HAVING clause was used without a GROUP BY clause.

Solution: You must use a GROUP BY clause in order to use the HAVING clause.