Ji-Yuhang
4/11/2019 - 11:30 AM

oracle数据库在排序后分页需要3层select from

oracle数据库在排序后分页需要3层select from

select OuterWrap.*
from (
    SELECT ROWNUM as AfterOrderRowNum,  Wrap.*
    FROM (
        SELECT  "RechargeOrder"."CREATE_TIME" AS "RechargeOrder_CREATE_TIME" ,
               ROWNUM AS "BeforeOrderRowNum"
        FROM "T_RECHARGE_ORDER" "RechargeOrder"
        ORDER BY "RechargeOrder"."CREATE_TIME" DESC
        ) Wrap

    where ROWNUM < 100
    ) OuterWrap
where AfterOrderRowNum >= 5