0406三种SQL分页法阅读(6560)条2013/4/6 14:06:46
以下是我收集的三种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 IDSELECT TOP 页大小 *FROM TestTableWHERE (ID NOT IN (SELECT TOP 页大小*页数 id FROM 表 ORDER BY id))ORDER BY ID&n...阅读全文
Taget:sql 分页 查询