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

This commit is contained in:
Robin Bygrave committed 2021-03-15 22:43:25 +13:00
1 parent 733886c70b
commit c2a87a0c88
2 files changed
+18 -1

No files matched your search

@@ -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();