自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

一個(gè)利用CTE遞歸在存儲(chǔ)過程中實(shí)現(xiàn)真分頁的代碼示例

數(shù)據(jù)庫 SQL Server
本文主要給出了一個(gè)利用CTE遞歸在存儲(chǔ)過程中實(shí)現(xiàn)真分頁的代碼示例,供初學(xué)者參考,希望能夠?qū)δ兴鶐椭?/div>

利用CTE遞歸存儲(chǔ)過程中實(shí)現(xiàn)真分頁的技術(shù)還是比較簡單的,本文我們給出了一個(gè)利用CTE遞歸在存儲(chǔ)過程中實(shí)現(xiàn)真分頁的代碼示例,對(duì)于初學(xué)者來說可以套用下面的代碼,代碼示例如下:

  1. SET ANSI_NULLS ON    
  2.  
  3. GO    
  4.  
  5. SET QUOTED_IDENTIFIER ON    
  6.  
  7. GO    
  8.  
  9. ALTER proc [dbo].[BIReport_GetAllReport_Page]    
  10.  
  11. @currentpage int,--當(dāng)前頁碼     
  12.  
  13. @pagesize int  --每頁顯示的條數(shù)     
  14.  
  15. as      
  16.  
  17. declare @beginindex   int    
  18.  
  19. declare @endindex  int    
  20.  
  21. begin    
  22.  
  23. select @beginindex=(@currentpage-1)*@pagesize    
  24.  
  25. select @endindex=@beginindex+@pagesize    
  26.  
  27. end     
  28.  
  29. begin    
  30.  
  31. With X as   --CTE遞歸          
  32.  
  33. (        
  34.  
  35. Select *, row_number() over(order by ReportId) as rowNum    
  36.  
  37. From BIReport    
  38.  
  39. )    
  40.  
  41. select * from X     
  42.  
  43. where rowNum between @beginindex+1 and @endindex    
  44.  
  45. end 

 

以上就是利用CTE遞歸在存儲(chǔ)過程中實(shí)現(xiàn)真分頁的代碼,希望通過閱讀上面的代碼,能夠帶給您一些收獲吧。

【編輯推薦】

  1. 如何Master Data Service調(diào)用API創(chuàng)建Model
  2. SQL查詢優(yōu)化實(shí)例:銀行校園卡繳費(fèi)的性能優(yōu)化
  3. SQL Server 2008數(shù)據(jù)庫Analysis Services基礎(chǔ)知識(shí)介紹
  4. SQL Server CPU性能排查及優(yōu)化相關(guān)SQL語句使用簡介
  5. SQL無人值守安裝的IACCEPTSQLSERVERLICENSETERMS參數(shù)
責(zé)任編輯:趙鵬 來源: CSDN博客
相關(guān)推薦

2010-05-05 17:19:32

Oracle存儲(chǔ)過程

2010-05-05 14:55:15

Oracle存儲(chǔ)過程

2010-04-29 17:31:56

Oracle存儲(chǔ)過程

2010-04-12 09:26:52

Oracle查詢分頁

2011-05-17 15:13:59

oracle分頁存儲(chǔ)

2011-08-16 16:59:58

PLSQL分頁存儲(chǔ)過程Java

2012-04-23 15:10:18

ASP.NET

2010-04-16 10:42:10

Oracle存儲(chǔ)過程

2011-08-18 17:32:40

Oracle存儲(chǔ)過程利用游標(biāo)返回結(jié)果集

2010-11-29 09:12:46

sybase分頁存儲(chǔ)過

2011-03-28 09:56:03

存儲(chǔ)增刪操作

2010-10-11 09:05:40

SQL Server

2010-04-30 08:47:22

Oracle分頁存儲(chǔ)

2011-04-11 17:28:50

oracle存儲(chǔ)select語句

2017-12-19 07:09:22

數(shù)據(jù)中心合并IT

2009-07-23 14:10:38

Hibernate J

2011-08-11 14:35:47

SQL Server插入更新

2010-03-30 13:19:57

Oracle存儲(chǔ)

2010-06-11 14:41:20

MySQL分頁查詢

2016-09-07 20:28:17

MySQL存儲(chǔ)數(shù)據(jù)庫
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)