由于业务场景需要,根据Oracle数据库,有俩种分页查询的方法(本实例主要提供方法)。
第一种分页方法:
select *
from (select rownum as rn, table_alias.*
from (select t.*
from a_persona_top t
order by (nvl(t.record_score, 60) +
nvl(t.clearance_score, 60) +
nvl(t.economic_score, 60) +
nvl(t.liquidity_score, 60) +
nvl(t.negative_score, 60)) desc) table_alias
where rownum <= 30)
where rn > 15
第二种分页方法:
select table_alias.*
from (select t.*, ROW_NUMBER() OVER(order by nvl(t.record_score, 60) +
nvl(t.clearance_score, 60) +
nvl(t.economic_score, 60) +
nvl(t.liquidity_score, 60) +
nvl(t.negative_score, 60) desc) as rn
from a_persona_top t ) table_alias
where rn>15 and rn <= 30