--oracle方法1select * from (select a.*, rownum rn from (select * from ss_custinfo) awhere rownum lt;= 40)where rn gt;=
--oracle方法1
select * from
(
select a.*, rownum rn from (select * from ss_custinfo) a
where rownum )
where rn >= 21;
--oracle方法2
select * from
(
select ss.*, rownum rn from ss_custinfo ss
)
where rn = 21;
--oracle方法3
select * from
(
select a.*, rownum rn
from (select * from ss_custinfo) a
)
where rn between 21 and 40;
--sybase
select * from
(
select ss.*, row_number() over (order by cust_id desc ) as rn
from ss_custinfo ss
) temp
where temp.rn=21;
select * from
(
select ss.*, row_number() over (partition by cust_id order by salary desc) rn
from ss_custinfo ss
) temp
where temp.rn=21;
,