limit的用法:
限制条目:
limit[offset] N
offset:偏移量
N:取出条目
取出第三条到第五条,limit 2,3
1.查询数据表的最后一条数据
select * from table where id =xxx order by id desc limit 1
2.查询出第一到第十条的数据(分页的时候可以使用)
SELECT * FROM table LIMIT 1,20