Hydra Error 304 HAVING can only have expressions with aggregates or columns in GROUP BY clause.

In this blog post, let’s learn about the error message “304 HAVING can only have expressions with aggregates or columns in GROUP BY clause.” in Hydra and the description of the error.

Error Message

304 HAVING can only have expressions with aggregates or columns in GROUP BY clause.

Error Details

The HAVING clause is used to select completed rows after grouping has been done. Therefore, the only selected values that it can test are values that are available in completed groups of rows, namely the single columns that are named in the GROUP BY clause and aggregate values. Review the HAVING clause with this rule in mind. If you want to select particular rows before grouping has taken place, use the WHERE clause.