美文网首页 聚合函数,统计总数,求和,平均值,最大值,最小值,字符串函数
聚合函数,统计总数,求和,平均值,最大值,最小值,字符串函数
作者:
孤岛渔夫 | 来源:发表于
2017-01-22 16:18 被阅读0次-- 聚合函数
-- count() 统计总个数
select count(id) from student;
select count(id) as 别名 from student;
-- sum() 求和
select sum(age) from student;
-- avg() 平均值
select avg(sid) from student;
-- max() 最大值
select max(age) from student;
-- min() 最大值
select min(age) from student;
-- 字符串函数
-- concat(str1, str2, str3, ....., strN)
select concat(sid,' - ',name) as abc from student;
本文标题: 聚合函数,统计总数,求和,平均值,最大值,最小值,字符串函数
本文链接:https://www.haomeiwen.com/subject/zudobttx.html
网友评论