Oracle创建视图实现获取当前数据所在的页数,这里以每页2条数据分页

摘要:Oracle创建视图实现获取当前数据所在的页数,这里以每页2条数据分页,详细请看:

一:

DROP VIEW MIP.TB_CMS_FLGTINFO_D_VIEW;

/* Formatted on 2014/12/4 8:35:36 (QP5 v5.115.810.9015) */
CREATE OR REPLACE FORCE VIEW MIP.TB_CMS_FLGTINFO_D_VIEW
(
   ID,
   A_TOBT,
   A_WEATHER,
   ABNS,
   ACFT,
   AIRLINE,
   ASAT,
   BCTM,
   BOTM,
   BETM,
   C_TOBT,
   COBT,
   CTOT,
   DINT,
   DLAB,
   DNAP,
   DOUT,
   DPRT,
   EDDI,
   EOBT,
   EPGT,
   EPOT,
   FATD,
   FFID,
   FLIGHTMARK,
   FLIGHTNUMBER,
   FSTD,
   GROUNDDISTRIBUTION,
   INTERNALORINTERNATIONAL,
   LMDT,
   LMUR,
   OFTM,
   PARK,
   RENO,
   RWAY,
   STDI,
   STND,
   TERMINAL,
   TSAT,
   SDEC,
   ROW_NUMBER,
   PAGE_SIZE
)
AS
     SELECT   t."ID",
              t."A_TOBT",
              t."A_WEATHER",
              t."ABNS",
              t."ACFT",
              t."AIRLINE",
              t."ASAT",
              t."BCTM",
              t."BOTM",
              t."BETM",
              t."C_TOBT",
              t."COBT",
              t."CTOT",
              t."DINT",
              t."DLAB",
              t."DNAP",
              t."DOUT",
              t."DPRT",
              t."EDDI",
              t."EOBT",
              t."EPGT",
              t."EPOT",
              t."FATD",
              t."FFID",
              t."FLIGHTMARK",
              t."FLIGHTNUMBER",
              t."FSTD",
              t."GROUNDDISTRIBUTION",
              t."INTERNALORINTERNATIONAL",
              t."LMDT",
              t."LMUR",
              t."OFTM",
              t."PARK",
              t."RENO",
              t."RWAY",
              t."STDI",
              t."STND",
              t."TERMINAL",
              t."TSAT",
              t."SDEC",
              ROWNUM AS ROW_NUMBER,
              DECODE (MOD (ROWNUM, 2),
                      0, TRUNC (ROWNUM / 2),
                      TRUNC (ROWNUM / 2) + 1)
                 AS PAGE_SIZE
       FROM   TB_CMS_FLGTINFO_D t
   ORDER BY   t.FSTD DESC;

你可能感兴趣的:(oracle)