回覆列表
  • 1 # maimi32709

    sql語句如下:分頁1SELECT * FROM (Select ROWNUM AS ROWNO, T.* from 表名 T(別名) where 表字段 between to_date("20060501", "yyyymmdd") and to_date("20060731", "yyyymmdd") AND ROWNUM = 10;經過測試,此方法成本最低,只巢狀一層,速度最快,即使查詢的資料量再大,也幾乎不受影響,速度依然.分頁2:SELECT * FROM (SELECT TT.*, ROWNUM AS ROWNO FROM (Select t.* from 表名 T(別名) where flight_date between to_date("20060501", "yyyymmdd") and to_date("20060531", "yyyymmdd") ORDER BY FACT_UP_TIME, flight_no) TT(別名二) WHERE ROWNUM = 10;經過測試,此方法隨著查詢範圍的擴大,速度也會越來越慢,

  • 2 # 使用者2458114238191884

    sql語句如下:

    分頁1

    SELECT *

    FROM (Select ROWNUM AS ROWNO, T.*

    from 表名 T(別名)

    where 表字段 between to_date("20060501", "yyyymmdd") and to_date("20060731", "yyyymmdd")

    AND ROWNUM

    WHERE TABLE_ALIAS.ROWNO >= 10;

    經過測試,此方法成本最低,只巢狀一層,速度最快,即使查詢的資料量再大,也幾乎不受影響,速度依然.

    分頁2:

    SELECT *

    FROM (SELECT TT.*, ROWNUM AS ROWNO

    FROM (Select t.*

    from 表名 T(別名)

    where flight_date between to_date("20060501", "yyyymmdd") and

    to_date("20060531", "yyyymmdd")

    ORDER BY FACT_UP_TIME, flight_no) TT(別名二)

    WHERE ROWNUM

    where TABLE_ALIAS.rowno >= 10;

    經過測試,此方法隨著查詢範圍的擴大,速度也會越來越慢,

  • 中秋節和大豐收的關聯?
  • 夏七夕的小說《妖孽只在夜裡哭》結局陸塵埃和誰在一起了?