27
06/14
三种SQL分页法
三种SQL分页法 [导读]表中主键必须为标识列,[ID] int IDENTITY (1,1) 1.分页方案一:(利用Not In和SELECT TOP分页)语句形式: SELECT TOP 10 *FROM TestTableWHERE (ID NOT IN (SELECT TOP 20 id FROM TestTable ORDER BY id))ORDER BY ... 表中主键必须为标识列,[ID] int IDENTITY (1,1) 1.分页方案一:(利用Not In和SELECT TOP分页) 语句形式: SELECT TOP 10 * FROM TestTable WHERE (ID NOT IN (SELECT TOP 20 id FROM TestTable ORDER BY id)) ORDER BY ID SELECT TOP 页大小 * FROM TestTa...