select * from (select * from Ft_Sms_Interact_Dt order by send_time desc) where handle_status='0' and handle_user is null and rownum<6;
这条语句能查出想要的结果,但是如果转换成HQL:
select * from (select * from FtSmsInteractDt order by sendTime desc) where handleStatus='0' and handleUser is null and rownum<?;
就会报下面的异常:
unexpected token: * near line 1, column 8 [select * from (select * from com.umessage.smsManager.domain.FtSmsInteractDt order by sendTime desc) where handleStatus='0' and handleUser is null and rownum<?]
查了一下应该是hql中子查询语句不能放在where前面,试了好多办法,都没有得到想要的数据,求大神指点
Smart猫小萌
蝴蝶刀刀