【数据分析师_02_SQL+MySQL】016_MySQL的数据汇聚AVG,COUNT,MAX,MIN,SUM

MySQL的数据汇聚AVG,COUNT,MAX,MIN,SUM


没啥好看的,简单的很

1 AVG平均

select avg(prod_price) from products
where vend_id = 1003 ;

2 count计数

select count(*) as num_count from products ;

3 Max/Min 最大值/最小值

select max(prod_price) from products ;

select min(prod_price) from products ;

5 Sum求和

select sum(quantity) from orderitems where order_num = 20005 ;
上一篇:大数据开发之Hive篇10-Hive高级查询with语句


下一篇:ElasticSearch笔记-聚合查询