Sqlserver数据库分页查询一直是Sqlserver的短板,闲来无事,想出几种方法,假设有表ARTICLE,字段ID.YEAR...(其他省略),数据53210条(客户真实数据,量不大),分页查询每页30条,查询第1500页(即第45001-45030条数据),字段ID聚集索引,YEAR无索引,Sqlserver版本:2008R2 第一种方案.最简单.普通的方法: ID FROM ARTICLE ORDER BY YEAR DESC, ID DESC) ORDER BY YEAR DESC,
use master IF EXISTS (SELECT * FROM sys.databases WHERE name = 'gpdb83sp')BEGIN DROP DATABASE gpdb83spEND; CREATE DATABASE gpdb83spON( NAME = gpdb83sp_data, FILENAME = 'C:\sql_data_files\getpaid\gpdb83sp.mdf', SIZE = 10MB, MAXSIZE = UNLIMITED,