count
条数
select count(1) as count from student;--效率最高
select count(*) as count from student;
select count(distinct score) from student; -- 去重
select classno,count(1) from student group by classno;
avg
平均数
select avg(score) score from student;
select avg(distinct score) from student; -- 去重
select classno,avg(score) score from student group by classno;
max
最大值
select max(score) from student;
select classno, max(score) score from student group by classno;
min
最小值
select min(score) from student;
select classno, min(score) score from student group by classno;
stddev
-- standard deviation)标准差
select stddev(score) from student;
select classno, stddev(score) score from student group by classno;
sum
和
select sum(score) from student;
select classno, sum(score) score from student group by classno;
median
--中位数
select median(score) from student;
select classno, median(score) score from student group by classno;