武器装备
oracle分页(oracle使用rownum分页)

oracle使用rownum分页

rownum行号:当我们做select操作时,每查询出的一条记录,就会在该行记录上加上一个行号,行号从一开始,不能跳着走,

排序操作会影响rownum的顺序

rownum不能写上大于一个整数,(rownum>4--错误)


例如,每页10条,查询第二页

select * from(	select a.*,rownum rn	from	(		select * 		from parm_table_basic_check		order by table_name,column_name	) a	where rownum<=20) b where b.rn>=11

----other

with temp1 as(     select *      from parm_table_basic_check     order by table_name,column_name)select * from(  select temp1.*,rownum rn  from temp1  where rownum<=20) b where b.rn>=11

2021-12-11


顶一下()     踩一下()

热门推荐

发表评论
0评