首页 > 代码库 > SQL TOP 分页

SQL TOP 分页

1 SELECT TOP 每页大小 * 2 FROM Test 3 WHERE 4     ID NOT IN           5         (SELECT TOP 每页大小*页数 id          6         FROM Test          7         ORDER BY id)8 ORDER BY ID

 

例子:

1 SELECT TOP 10 * 2 FROM Test 3 WHERE 4     ID NOT IN           5         (SELECT TOP 20 id          6         FROM Test          7         ORDER BY id)8 ORDER BY ID

 

SQL TOP 分页