应该是说小于100的数据改一下: select a.* from ( SELECT a.*,row_number() over(order by CustomerLotID desc) rn FROM dutbin a ) where rn<=100 order by rn
1楼的正解啊。oracle里面有没limit!
order by是取某一段值得函数?
取前100个数据再根据CustomerLotID排列: select * from dutbin where rownum<101 order by CustomerLotID 根据CustomerLotID对全表排列,再取前100个数据再: select * from (select * from dutbin order by CustomerLotID) where rownum<101
什么意思先解释下
select a.*
from
(
SELECT a.*,row_number() over(order by CustomerLotID desc) rn FROM dutbin a
)
where rn<=100
order by rn
select * from dutbin where rownum<101 order by CustomerLotID
根据CustomerLotID对全表排列,再取前100个数据再:
select * from (select * from dutbin order by CustomerLotID) where rownum<101