您的位置:首页 > 数据库 > Oracle

oracle 的rownum

2016-04-12 15:36 465 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/u014194661/article/details/51133946

select awmid,yxjstpath,to_char(awmtime,'yyyy-mm-dd') as awmtime,awmaddress,hostempname,joinnum 
from (select t.awmid,t.yxjstpath,t.awmtime,t.awmaddress,t.hostempname,t.joinnum from 
b_r_assignworkmeeting t  where  t.yxjstpath is not null and t.deptid =" + deptid + "
order by t.recorddate desc ,t.awmid desc )  where rownum<=10

select t.awmid,t.yxjstpath,t.awmtime,t.awmaddress,t.hostempname,t.joinnum from  b_r_assignworkmeeting t 
where  rownum<=10 and t.yxjstpath is not null and t.deptid =" + deptid + "order by t.recorddate desc ,t.awmid desc


两种查询结果在某种情况下,查询结果不一样, 第一种查询最新10条是正确的。oracle的bug


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: