Mysql集合函数

#集合函数查询

#匹配做多行数的数据 也可以指定某个列  不统计空值 全表扫描
select count(*) from t11;

#求和函数 指定列上面的求和  只能是数字类型 全表扫描
select sum(age) from t11;

#平均数
select avg(age) from t11;

#最大值 max函数 有没有索引没关系 都是全表扫描对比
select max(age) from t11;

#最小值
select min(age) from t11;

发布了25 篇原创文章 · 获赞 0 · 访问量 500

猜你喜欢

转载自blog.csdn.net/luojiawen208/article/details/105033818
今日推荐