需求:查询表dbo.Message,每页10条,查询第2页1:TOP()SELECT TOP(20) * FROM dbo.Message WHERE Code NOT IN(SELECT TOP(10) Code FROM dbo.Message)2:BETWEEN * AND * , Row_Number() OVER(ORDER BY *) AS rowNumSELECT *,ROW_NUMBER() OVER(O..
临近春节,心早已飞了不在工作上了,下面小编给大家整理些数据库的几种分页查询。Sql Sever 2005之前版本:select top 页大小 *from 表名where id not in(select top 页大小*(查询第几页-1) id from 表名 order by id)order by id 例如:select top..