SQL分頁實現

select *
  from (select t.*, rownum rn
          from (select * from c_order order by order_id) t --column
         where rownum <= 8) --endindex
 where rn >= 1 --beginindex

sqlserver
select top 8 * --結束位置
  from org_staff
 where id not in
       (select top 5 id from org_staff order by id asc)--起始位置
 order by id asc

發佈了30 篇原創文章 · 獲贊 1 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章