orcale 数据库分页查询 SQL语句写法:推荐第三种
--分页查询一
select *
from (select a1.*, rownum rn
from (select * 数据库表名) a1
where rownum <= 5)
where rn >= 1;
--分页查询二
select a1.*
from (select 数据库表名.*, rownum rn from 数据库表名 where rownum <= 5) a1
where rn >= 1;
--分页查询三
select a1.*
from (select 数据库表名.*, rownum rn from 数据库表名) a1
where rn between 1 and 5;
一:
select *
from (select c.status
from c_claim_tasks c
where c.stage = '007')
where rownum <= 5
and rownum >= 1;
二:
select *
from (select c.status
from c_claim_tasks c
where stage = '007')
where rownum between 1 and 5