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;