排序方式:
升序——asc(默認:從小到大)
降序——desc(由大到?。?/p>
# 排序語法:
order by 字段1 [asc]|desc[,字段2 [adc]|desc,……]
# limit 和排序結(jié)合起來用,取前面的多少條數(shù)據(jù)
# 在limit后面只有一個數(shù)字時,表示在結(jié)果集中取前m條數(shù)據(jù)
# 在limit后面有兩個數(shù)字時,表示在結(jié)果集中取m+1開始取n條數(shù)據(jù)
limit m[,n]
select * form teachers order by tage desc limit 2;
# 分頁
limit (頁碼-1)*每頁顯示信息數(shù),每頁顯示信息數(shù);