时间:2021-07-01 10:21:17 帮助过:11人阅读
平均数
select avg(shop_price) from goods;
求最大最小
select min(shop_price) from goods;
select max(shop_price) from goods;
求行数
select count(*) from goods;
分组统计
group 是需要耗费资源的 会有排序
slect cat_id,avg(shop_price) from goods group by cat_id;
select cat_id,count(*) from goods group by cat_id;
select cat_id,max(good_price)) from goods group by cat_id;
msql 统计函数 and 分组统计
标签:max sele min bsp group sql 统计 排序 msql