我的查询
def myQuery = PublicTraining.executeQuery("SELECT t.id, t.isSoldOut, t.course.ebPrice, t.offerPrice FROM PublicTraining t Where exists (from t.course.tracks AS tracks where tracks.id IN (1) )")
这会返回多个记录,这是错误的
如果我将其更改为
def myQuery = PublicTraining.executeQuery("SELECT t.id FROM PublicTraining t Where exists (from t.course.tracks AS tracks where tracks.id IN (1) )")
它返回正确的结果集
为什么选择列会更改此处的结果集?
最佳答案
关于hibernate - Grails ExecuteQuery在选择时给出了不同的结果集,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19181093/