聚合函数,统计总数,求和,平均值,最大值,最小值,字符串函数

-- 聚合函数

-- 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;


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容