Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要选择我给出的 extId == 参数的记录,并从这些记录中选择我想要最新的日期(createDate属性)。我正在尝试这个:
createDate
select r from Record r where r.extId=:eid and r.createDate=(select max(r.createDate) from r where r.id=r.id)
只需返回最新记录。请帮帮我。
你可以试试这个查询,它对我有用。
from Record r where r.extId=:eid and r.createDate IN (select max(r2.createDate) from Recordr2)