Grails “max” subquery with an association, to get only the latest of a hasMany

假装没事ソ 提交于 2019-12-06 11:24:37

There was a question a couple of days ago very similar to this. It appears that using where queries with a 'max' subquery doesn't work well with ==

The OP was able to get it to work with < and worked around it that way. Looking at the docs on where queries has not helped me figure this one out.

Here is a really wild guess -

    Txn.where {
        txnStatus  {
          dateTime == property(dateTime).of { max(dateTime) }
        }
    }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!