分页原理 TOP/ROW_NUMBER()

分页原理 TOP/ROW_NUMBER()

绿林寻猫
2021-12-08 / 0 评论 / 169 阅读 / 正在检测是否收录...

SELECT TOP 10 * FROM STUINFO WHERE STUNO NOT IN(SELECT TOP (10*(当前显示页-1)) STUNO FROM STUINFO ORDER BY STUNO)

SELECT * FROM (SELECT *,ROW_NUMBER() OVER(ORDER BY STUNO) CID FROM STUINFO) A WHERE CID BETWEEN 1 AND 10

0

评论 (0)

取消