Column '{0}' is invalid in the HAVING clause because it is not contained in either an aggregate function or the GROUP BY ...