我的查询
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) )")
它返回正确的结果集
为什么列的选择会改变这里的结果集?