我如何翻译:
SELECT COUNT(*) AS `count`,`a` FROM `b` GROUP BY `a` ORDER BY `a`
进入grails或gorm查询?
解决方法
从grails 1.2开始,您可以通过创建的别名创建别名和顺序.
有关详细信息,请参见https://cvs.codehaus.org/browse/GRAILS-3875和https://cvs.codehaus.org/browse/GRAILS-3655.
def c = b.createCriteria() def results = c { projections { groupProperty("a") count("a",'myCount') //Implicit alias is created here ! } order 'myCount' }