sqlserver分頁的兩種寫法分別介紹建站知識
導讀:1建站知識本文將介紹sql server傳統的寫法與SQL Server2005以后的分頁語句需要了解的朋友可以參考下網站seo優化軟件網站建設多少錢。
第一種是最傳統的寫法,用存儲過程中的變量作為分頁的乘數
復制代碼 代碼如下:
[c-sharp] view plaincopyprint?create proc p_paged1 @pageSize int,@currentPage int as select網站建設哪家好 top (@pageSize) * from student where idseo網站優化軟件 not in (select top (@pageSize*(@currentPage-1)) id from student) go exec p_paged1 2,3 create pro企業網站建設c p_paged1 @pageSize int,@currentPage int as select top (@pageSize) * from student where id not in (select top (@pageSize*(@currentPage-1)) id from student) go exec p_paged1 2,3
--SQL Server2005以后的分頁語句復制代碼 代碼如下:
[c-sharp] view plaincopyprint?create proc p_paged2 @pageStart int, @pageEnd int as select * from (select *,row_number() over(order by id desc) as rnum from student) t where t.rnum between @pageStart and @pageEnd go exec p_paged2 5,10
相關網站seo優化軟件網站建設多少錢。聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-24 ,文章sqlserver分頁的兩種寫法分別介紹建站知識主要講述兩種,分頁,sqlserver分頁的兩種寫法分別介紹建站知網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_6618.html