#2196 - SQLException:Column "T0.ID" must be in the GROUP BY list - when findCount with having clause

This commit is contained in:
Robin Bygrave
2021-03-15 22:43:25 +13:00
parent 733886c70b
commit c2a87a0c88
2 changed files with 18 additions and 1 deletions
@@ -151,7 +151,7 @@ public final class SqlTreeBuilder {
}
private String buildGroupByClause() {
if (rawSql || !rootNode.isAggregation()) {
if (rawSql || (!rootNode.isAggregation() && query.getHavingExpressions() == null)) {
return null;
}
ctx.startGroupBy();