MySQL查询排序和分页

1.升序(asc)

  select * from `students` order by `id` asc;

2.降序(dasc)

  select * from `students` order by `id` desc;

3.排序(limit)

  语法:limit 起始值,显示范围

  例:select * from `students` limit 1,5;

  补充:若第一页limit 1,5,则第二页6,5.....每页显示5行

 

MySQL查询排序和分页

上一篇:mysql45讲(2)


下一篇:MySQL基础知识