(一)掌握分頁存儲過程sql
例題:從Car表中查出第四頁的記錄,每頁爲三條記錄。spa
--分析 --取一頁數據出來 select top 3 * from car --跳過n條記錄 --1.找出前n條的主鍵值 select top 6 code from car order by code ---2.跳過去 select top 3 * from Car where Code not in(select top 6 code from car order by code) go --解決方法 create proc UP_CAR_PAGE @pageSize int, @pageNo int as declare @sql varchar(500)--明白500表明的意思 set @sql ='select top '+cast(@pageSize as varchar(50))+' * from car where code not in (select top '+cast(@pageSize*(@pageNo-1) as varchar(50))+' code from car order by code)' exec (@sql) --注意:exec後面要跟括號 go up_car_page 3,4
(二)思惟導圖code
SQLServer思惟導圖blog
C#思惟導圖ast