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