SQL分页获取数据

SQL Server分页

select * from 
(select row_number() over(order by MaterialNM) as rowId, * from MDMMaterials where EditState='0') t
where rowId between 1 and 100

Oracle分页

SELECT * FROM 
(SELECT rownum AS rn,MaterialNM,EditState FROM MDMMaterials WHERE EditState='0' ORDER BY MaterialNM) t
WHERE rn BETWEEN 1 AND 100

 

posted @ 2016-05-05 13:18  zhchsh  阅读(731)  评论(0编辑  收藏  举报