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行

 

posted @ 2021-04-01 21:50  小孙sy  阅读(208)  评论(0编辑  收藏  举报