<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