時間:2024-03-08 08:50作者:下載吧人氣:22
sqlserver2008不支持關(guān)鍵字limit ,所以它的分頁sql查詢語句將不能用MySQL的方式進行,幸好sqlserver2008提供了top,rownumber等關(guān)鍵字,這樣就能通過這幾個關(guān)鍵字實現(xiàn)分頁。
下面是本人在網(wǎng)上查閱到的幾種查詢腳本的寫法:
幾種sqlserver2008高效分頁sql查詢語句
top方案:
sql code:
select top 10 * from table1
where id not in(select top 開始的位置 id from table1)
網(wǎng)友評論