DEMO
--创建表 create table cux_num_temp( name varchar2(100), age number, addtime date ); ---插入测试数据 insert into cux_num_temp(name,age,addtime)values('123',99,sysdate); insert into cux_num_temp(name,age,addtime)values('234',101,sysdate); insert into cux_num_temp(name,age,addtime)values('345',102,sysdate); insert into cux_num_temp(name,age,addtime)values('456',103,sysdate); insert into cux_num_temp(name,age,addtime)values('567',104,sysdate); insert into cux_num_temp(name,age,addtime)values('678',105,sysdate); insert into cux_num_temp(name,age,addtime)values('789',106,sysdate); insert into cux_num_temp(name,age,addtime)values('111',107,sysdate); insert into cux_num_temp(name,age,addtime)values('112',108,sysdate); insert into cux_num_temp(name,age,addtime)values('113',109,sysdate); 第一种: select * from (select a.*, row_number() over(order by addtime) rn from cux_num_temp a) where rn > 5 and rn <= 10 第二种: select * from (select b.*, rownum rn from (select a.* from cux_num_temp a order by addtime) b) where rn between 6 and 10;
标签:10,name,temp,addtime,age,cux,条到,num,Oracle From: https://www.cnblogs.com/ivenlin/p/18119107