您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Oralce分页-查询21到40条的数据

2024/5/19 12:59:52发布20次查看
--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;

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product