当前位置:网站首页>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 .
边栏推荐
- [combinatorics] recursive equation (general solution structure of recursive equation with multiple roots | linear independent solution | general solution with multiple roots | solution example of recu
- Qt调节Win屏幕亮度和声音大小
- [combinatorics] recursive equation (case where the non-homogeneous part is exponential | example where the non-homogeneous part is exponential)
- Great changes! National housing prices fell below the 10000 yuan mark
- Life is still confused? Maybe these subscription numbers have the answers you need!
- Applet setting multi account debugging
- Where is the monitoring page of RDS database?
- c# . Net tool ecosystem
- Servlet specification Part II
- Detailed explanation of common network attacks
猜你喜欢

【RT-Thread】nxp rt10xx 设备驱动框架之--Audio搭建和使用
![[RT thread] NXP rt10xx device driver framework -- Audio construction and use](/img/85/32a83eaa4b7f5b30d4d7c4f4c32791.png)
[RT thread] NXP rt10xx device driver framework -- Audio construction and use

1147_ Makefile learning_ Target files and dependent files in makefile
![[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th](/img/f1/c96c4a6d34e1ae971f492f4aed5a93.jpg)
[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th

Test your trained model

【RT-Thread】nxp rt10xx 设备驱动框架之--hwtimer搭建和使用

SQL injection database operation foundation

Deops入门

Automata and automatic line of non-standard design

UE4 official charging resources, with a total price of several thousand
随机推荐
数仓任务里面 跑SQL任务的时候用的数据库账号是在哪里配置的
September, 19, "cam principle and application" online assignment [Full Score answer]
First day of rhcsa study
Vs code plug-in korofileheader
Leetcode13. Roman numeral to integer (three solutions)
PHP processing - watermark images (text, etc.)
[combinatorics] recursive equation (solution of linear non-homogeneous recursive equation with constant coefficients | standard form and general solution of recursive equation | proof of general solut
[combinatorics] recursive equation (general solution structure of recursive equation with multiple roots | linear independent solution | general solution with multiple roots | solution example of recu
1164 Good in C
Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos
1164 Good in C
IntelliJ 2021.3 short command line when running applications
Loop through JSON object list
[RT thread] NXP rt10xx device driver framework -- RTC construction and use
Assignment examination questions of advanced English (III) for the course examination of Fujian Normal University in February 2022
An example of HP array card troubleshooting
When absolutely positioned, the element is horizontally and vertically centered
简单配置PostFix服务器
University of Electronic Science and technology, accounting computerization, spring 20 final exam [standard answer]
AcWing 4489. 最长子序列