You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In GORM Data Services, using an aggregate expression inside @Where:
@Where({ amount > avg(amount) })
generates invalid SQL because the aggregate projection (avg(amount)) is applied directly to the outer WHERE clause instead of being encapsulated in a subquery (WHERE amount > (SELECT avg(amount) FROM ...)).
Expected Behavior
The AST transformation for @Where should properly emit a subquery expression when an aggregate function is referenced on the right-hand side of a comparison operator.
Activity
borinquenkid commentedon Oct 31, 2026
Targeted for Grails 9.