0
嘿傢伙,我有以下查詢和我的生活,我似乎無法將其翻譯成JPQL。工作SQL是:將SQL查詢轉換爲JPQL(Eclipselink)的問題
select * from TB_PRINT_DETAIL y inner join
(select JOB_ID,max(COPY_NUM) MAX_COPY_NUM from TB_PRINT_DETAIL group by JOB_ID ) x
on y.JOB_ID = x.JOB_ID and y.COPY_NUM = x.MAX_COPY_NUM
我的翻譯是如下愚蠢的嘗試:事先你可以照任何光線
select o from PrintDetailEntity o inner join (select o2.jobId, max(o2.copyNumber) as
maxCopyNum from PrintDetailEntity o2 group by o2.jobId) as x on o.jobId = o2.jobId and
o.copyNum = o2.maxCopyNum where o.printSuppressionReasonEntity is null
謝謝!
是的!謝謝,我不知道爲什麼我會遇到這樣的問題。 – DSmyte 2010-11-02 18:00:20