当前位置:网站首页>Total / statistics function of MySQL
Total / statistics function of MySQL
2022-07-06 17:25:00 【Cute new vegetable dog】
total / Statistical function
count function
select count(*) from student;
select count(*) from student where math > 90;
- count(*) and count( Column ) The difference between
- count(*) Return the number of rows of records that meet the conditions
- count( Column ) Count the number of columns that meet the conditions , But it will be excluded as null
sum function
- sum Functions only work with numbers , Otherwise, an error will be reported
- For multi column summation , It can't be less .
-- Count the total score of mathematics in a class
select sum(math) from student;
-- Count the total score of each subject in a class
select sum(english),sum(math),sum(chinese) from student;
-- Count the total scores of three subjects in a class
select sum(english+math+chinese) from student;
-- The average score of a Chinese class is one
select sum(chinese) / count(*) from student;
avg function
-- Average score of Statistical Mathematics
select avg(math) from student;
-- Average score of statistical total score
select avg(math + english + chinese) from student;
max/min function
-- Ask for the highest and lowest score of the class
select max(math + english + chinese) , min(math + chinese + english) from student;
-- Seek the highest and lowest scores in class mathematics
select max(math),min(math) from student;
边栏推荐
- 集成开发管理平台
- 唯有学C不负众望 TOP2 p1变量
- Interpretation of Flink source code (III): Interpretation of executiongraph source code
- How does wechat prevent withdrawal come true?
- Basic knowledge of assembly language
- 03个人研发的产品及推广-计划服务配置器V3.0
- Install docker under windows10 (through Oracle VM VirtualBox)
- Activiti directory (III) deployment process and initiation process
- 07个人研发的产品及推广-人力资源信息管理系统
- Redis快速入门
猜你喜欢
随机推荐
Learn the wisdom of investment Masters
暑假刷题嗷嗷嗷嗷
Eight part essay that everyone likes
【逆向】脱壳后修复IAT并关闭ASLR
[VNCTF 2022]ezmath wp
【逆向初级】独树一帜
Some feelings of brushing leetcode 300+ questions
CentOS7上Redis安装
复盘网鼎杯Re-Signal Writeup
Prototype chain inheritance
Ce n'est qu'en apprenant que c est à la hauteur des attentes Top5 s1e8 | s1e9: caractères et chaînes & opérateurs arithmétiques
MySQL string function
一个数10年工作经验的微服务架构老师的简历
【MMdetection】一文解决安装问题
Garbage first of JVM garbage collector
数据仓库建模使用的模型以及分层介绍
Final review of information and network security (based on the key points given by the teacher)
mysql的列的数据类型详解
Take you hand-in-hand to do intensive learning experiments -- knock the level in detail
EasyRE WriteUp









