• Your query works only if I omit the HAVING clause.