当前位置:网站首页>MySQL grouping query
MySQL grouping query
2022-07-03 17:35:00 【sshi9】
Group query
Group query mainly involves two clauses , Namely :group by and having
group by
Get the total salary of each job , Position name and total salary are required to be displayed
Group the raw data by position department and salary
Raw data
After grouping
having
If you want to filter the grouped data again, you need to use having Clause
The average salary for each position is greater than 2000
Execution order of grouping functions :
1. Query data according to criteria
2. grouping
3. use having Filter , Get the right data
select summary
A complete select The statement format is as follows :
select Field
from Table name
where …….
group by ……..
having …….( It exists to filter the grouped data — It cannot appear alone )
order by ……..
The execution order of the above statements
- First, execute where Statement to filter raw data
- perform group by Grouping
- perform having Operate on grouped data
- perform select Select data
- perform order by Sort
principle : Can be in where Data filtered in , As far as possible in where Medium filtration , More efficient .having The filtering of is dedicated to filtering the data after grouping .
边栏推荐
- IntelliJ 2021.3 short command line when running applications
- [mathematical logic] equivalent calculus and reasoning calculus of predicate logic (individual word | predicate | quantifier | predicate logic formula | two basic formulas | proposition symbolization
- [combinatorics] recursive equation (special solution example 1 Hannover tower complete solution process | special solution example 2 special solution processing when the characteristic root is 1)
- Automata and automatic line of non-standard design
- 互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
- Unity notes unityxr simple to use
- 2021 ICPC regional competition (Shanghai) g.edge groups (tree DP)
- Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
- 互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
- TensorBoard快速入门(Pytorch使用TensorBoard)
猜你喜欢
kubernetes资源对象介绍及常用命令(四)
1164 Good in C
2021 ICPC regional competition (Shanghai) g.edge groups (tree DP)
国内如何购买Google Colab会员
1146_ SiCp learning notes_ exponentiation
Swm32 series Tutorial 4 port mapping and serial port application
How to train mask r-cnn model with your own data
Cross border e-commerce: advantages of foreign trade enterprises in overseas social media marketing
Golang unit test, mock test and benchmark test
Select 3 fcpx plug-ins. Come and see if you like them
随机推荐
SWM32系列教程4-端口映射及串口应用
Financial management (Higher Vocational College) financial management online Assignment 1 in autumn 20
[vscode] convert tabs to spaces
Simple configuration of postfix server
c# . Net tool ecosystem
[combinatorics] recursive equation (four cases where the non-homogeneous part of a linear non-homogeneous recursive equation with constant coefficients is the general solution of the combination of po
MinGW compile boost library
Y is always discrete and can't understand, how to solve it? Answer: read it several times
How to purchase Google colab members in China
How to enforce parameters in PowerShell- How do I make parameters mandatory in PowerShell?
Stm32h7 Hal library SPI DMA transmission has been in busy solution
Squid service startup script
Rsync remote synchronization
基于主机的入侵系统IDS
STM32实现74HC595控制
kubernetes资源对象介绍及常用命令(三)
September, 19, "cam principle and application" online assignment [Full Score answer]
SQL injection database operation foundation
Where is the monitoring page of RDS database?
Applet setting multi account debugging