<query name="getStudyTasksByParticipantId">
from StudyTask st
join (select max(lastUpdatedDate)as lastUpdatedDate, study, clinicalStudyRegistration from
StudyTask where clinicalStudyRegistration.participant.id in (:participantIds)
group by study, clinicalStudyRegistration) lst
where st.lastUpdatedDate = lst.lastUpdatedDate
order by st.lastUpdatedDate desc
</query>
当我运行此查询时,它会给出错误,如unexpected token: (at line 3 col 30
。休眠查询错误
此查询有什么问题
什么是“line 3 col 30”? –
你不需要在participantIds的括号内,尽管如果它导致错误是很奇怪的。它告诉你的错误是与max(。之间是否有空格)和'as'之间的差异? – Woody