本文最后更新于 1204 天前,其中的信息可能已经有所发展或是发生改变。
1、排序 order by
升序 asc 降序 desc
语法:
select 字段名,…… from 表名 [ where 条件] order by 字段 asc|desc,字段 asc|desc……
order by 后面的字段第一个表示主排序,其他为次排序
2、统计函数
count(字段):计数
max(字段):最大
min(字段) :最小
avg(字段):平均
sum(字段):求和
语法
select 统计函数 from 表名
3、分组 group by 字段
select 统计函数,字段 from 表名 group by 字段名