SQL2005:取出指定的筆數

  • 2088
  • 0
  • 2016-05-17

摘要:SQL2005:取出指定的筆數

1 with test as (
2 select row_number() over (order by allot_no desc) as recno
3    , allot_no, allot_date, allot_amt
4 from allot )
5 select allot_no, allot_date, allot_amt
6 from test
7 where recno between 101 and 200

參考來源:diary.tw/tim/42

其它有關CTE:SQL 2005 T-SQL Enhancement: Common Table Expression