数据库分页【Limt与Limt..OFFSET 】
数据起始
![](https://images2015.cnblogs.com/blog/660140/201601/660140-20160111161127632-1464555537.png)
SELECT * from xiaoyao_blogs_essay limit 20 , 15;
解释:20是起始位置,15是页容量。因为id是从15开始的
![](https://images2015.cnblogs.com/blog/660140/201601/660140-20160111161243475-1417110656.png)
SELECT * from xiaoyao_blogs_essay limit 10 OFFSET 5;
解释:5是起始位置,10是页容量
![](https://images2015.cnblogs.com/blog/660140/201601/660140-20160111161422741-471798756.png)
由此可以看出limt与limit ..offset是相反的
MSSQL2012的分页
SELECT * FROM xiaoyao_blogs_essay ORDER BY id OFFSET 1 ROWS FETCH NEXT 50 ROWS ONLY;
1是起始页,50是页容量