当前位置:网站首页>How MySQL implements grouping sum
How MySQL implements grouping sum
2022-06-21 20:07:00 【Yisu cloud】
mysql How to achieve grouping sum
This article mainly introduces “mysql How to achieve grouping sum ”, In daily operation , I believe a lot of people are mysql There are doubts about how to achieve grouping sum , Xiao Bian consulted all kinds of materials , Sort out simple and easy-to-use operation methods , I hope to answer ”mysql How to achieve grouping sum ” Your doubts help ! Next , Please follow Xiaobian to learn !
stay mysql in , You can use “GROUP BY” Key words and SUM() Function to implement grouping summation , The grammar is “SELECT SUM( Field name to sum ) FROM Table name GROUP BY Field names to be grouped ;”.“GROUP BY” Keywords can group query results according to one or more fields , and SUM() The function returns the sum of the specified fields in different groups according to the grouping situation .
The operating environment of this tutorial :windows7 System 、mysql8 edition 、Dell G3 The computer .
stay mysql in , You can use “GROUP BY” Key words and SUM() Function to implement grouping summation .
“GROUP BY” Keywords can group query results according to one or more fields
SUM() The function returns the sum of the specified fields in different groups according to the grouping situation
SELECT SUM( Field name to sum ) FROM Table name GROUP BY Field names to be grouped ;
Example : For the data table mip_demo Of sex Field for grouping query , Then find out by grouping score The sum of the scores of boys and girls in the field .
Let's take a look first mip_demo The data table :
SELECT * FROM mip_demo;

Divide into groups to find the sum of boys' and girls' scores .
SELECT sex,SUM(score) FROM mip_demo GROUP BY sex;

Here we are , About “mysql How to achieve grouping sum ” That's the end of my study , I hope we can solve your doubts . The combination of theory and practice can better help you learn , Let's try ! If you want to continue to learn more related knowledge , Please continue to pay attention to Yisu cloud website , Xiaobian will continue to strive to bring you more practical articles !
边栏推荐
- Move Protocol Beta测试版进行时,瓜分生态核心权益MOMO
- mysql与oracle有没有区别
- mysql如何对列求和
- Implementation of assembly language greedy snake and Tetris dual task design (II) -- detailed design of greedy snake
- NSIS 运行bat的方法汇总
- mysql如何查询最大id值
- 出院小结识别api接口-医疗票据OCR识别/出院诊断记录/电子病历/理赔服务
- 机器学习之神经网络与支持向量机
- With a playback volume of up to 4000w+, how do couples get out of the ring by scattering dog food?
- Recycleview drag effect
猜你喜欢

出院小结识别api接口-医疗票据OCR识别/出院诊断记录/电子病历/理赔服务

W10 add system environment variable path

How to use devaxpress WPF to create the first MVVM application in winui?

2022-06-20

nacos-配置中心-源码

SQL operation: with expression and its application

动态规划【一】(背包问题)

在 KubeSphere 上部署 Apache Pulsar

Nacos configuration center source code

动态规划【二】(线性dp)
随机推荐
Grain College p40~43
Tableapi & SQL and example module of Flink
RecycleView懒加载失效问题(二)
inno setup 安装路径框学习
[interval and topic prefix sum] line segment tree (dynamic open point) application problem
[dry goods knowledge] redis: from the application to the bottom, one article will help you
Codeforces Round #394 (Div. 2) E. Dasha and Puzzle
CloudCompare&PCL 点云AABB包围盒
Post to asp Net core length limitation and solution when transferring data
Uniapp obtains login authorization and mobile number authorization (sorting)
Introduction to machine learning
麻烦问下,数据集成中的独享资源,无法正常连接某些数据库,可能是什么原因,以下的原因好像都不是。公共资
flink-connector-mysql-cdc-2.2.0,生成全量快照阶段,是按照Table
动态规划【一】(背包问题)
机器学习之绪论
QT creator 7.0 frequently asked questions and common usage
我记得MAXCOMPUTE里面是不可以写PROCEDURE,那如果想oracle procedure
zabbix6.0+timescaledb+企业微信告警
Jupyter Notebook启动方式及相关问题
Linux MySQL command