回覆列表
  • 1 # 使用者8827861907723

    根據時間條件排序,取前十條和後十條。

    1、有時間欄位, 根據時間條件排序,取前十條和後十條

    (1)前十條:

    select * from (select * from tab_name a order by date_col )

    where rownum<11;

    (2)後十條:

    select * from (select * from tab_name a order by date_col desc)

    where rownum<11;

    2、沒有時間欄位, 直接根據物理儲存順序,取前十條和後十條

    (1)前十條:

    select * from (select * from tab_name a order by rownum)

    where rownum<11;

    (2)後十條:

    select * from (select * from tab_name a order by rownuml desc)

    where rownum<11;

  • 中秋節和大豐收的關聯?
  • 壽喜燒(すき焼き)怎麼做?