平均数
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;
时间: 2024-10-10 04:04:31