wangdianchao

order by

1.升序

# 将employee表中的记录安装age字段中的数据升序排列。(默认为升序"asc"可不写)
select * from employee order by age asc;

2.降序

# 将employee表中的记录安装age字段中的数据降序排列。
select * from employee order by age desc;

3.多重排序

# 先按照age升序,再将相同age的降序排列。
select * from employee order by age asc,id desc;

 limit

# 查询employee表,只显示前三条记录
select * from employee limit 3;
# 查询employee表中,第4条开始,后面的5条记录。
select * from employee limit 3,5;

 

分类:

技术点:

相关文章:

  • 2019-01-29
  • 2021-09-21
  • 2021-09-21
  • 2021-06-14
  • 2021-11-28
  • 2022-12-23
  • 2022-01-02
猜你喜欢
  • 2021-10-18
  • 2022-12-23
  • 2021-09-17
  • 2021-11-20
  • 2022-12-23
  • 2022-01-19
  • 2021-12-19
相关资源
相似解决方案