当前位置:网站首页>MySQL advanced SQL statement (1)
MySQL advanced SQL statement (1)
2022-07-04 01:51:00 【kiroct】
select High level statements
Case study : Start with a database
DISTINCT : Do not display duplicate data records
function
Aggregate functions
String function
Group by Use !
Yes group by The query results of the following fields are summarized and grouped , Usually used in combination with aggregate functions
group by There is a principle , Namely SELECT In all the following columns , Columns that do not use aggregate functions , Must appear in GROUP BY Back .
HAVING: Used to filter by GROUP BY Statement returned recordset , Usually with GROUP BY Statements are used in conjunction with
create view : View , It can be thought of as a virtual table or a storage query .
The difference between a view and a table is , There are actually stored data records in the form , The view is a framework based on tables , It itself does not actually store data records . The temporary table disappears automatically when the user exits or loses the connection to the database , And the view doesn't disappear . Views don't contain data , Just store its definition , Its purpose - It can generally simplify complex queries . For example, you need to query several tables , But also to carry out statistical sorting and other operations SQL Sentences can be cumbersome , Join several tables with views , Then query the view , It's the same as querying a table , Very convenient .
A small summary :
边栏推荐
- ThinkPHP uses redis to update database tables
- Summary of JWT related knowledge
- Huawei rip and BFD linkage
- What is the intelligent monitoring system of sewage lifting pump station and does it play a big role
- Huawei cloud micro certification Huawei cloud computing service practice has been stable
- Hunan University | robust Multi-Agent Reinforcement Learning in noisy environment
- C import Xls data method summary IV (upload file de duplication and database data De duplication)
- 51 MCU external interrupt
- Cancer biopsy instruments and kits - market status and future development trends
- Who moved my code!
猜你喜欢
Luogu p1309 Swiss wheel
Introduction to graphics: graphic painting (I)
Life cycle of instance variables, static variables and local variables
Ka! Why does the seat belt suddenly fail to pull? After reading these pictures, I can't stop wearing them
Valentine's Day - 9 jigsaw puzzles with deep love in wechat circle of friends
What are the advantages and disadvantages of data center agents?
The reasons why QT fails to connect to the database and common solutions
Conditional statements of shell programming
Introduction to Tianchi news recommendation: 4 Characteristic Engineering
How to delete MySQL components using xshell7?
随机推荐
Customize redistemplate tool class
Writeup (real questions and analysis of ciscn over the years) of the preliminary competition of national college students' information security competition
Basic editing specifications and variables of shell script
Solution to the problem that jsp language cannot be recognized in idea
Do you know the eight signs of a team becoming agile?
[typora installation package] old typera installation package, free version
Software product download collection
What are the advantages and disadvantages of data center agents?
Jerry's watch information type table [chapter]
Conditional test, if, case conditional test statements of shell script
[leetcode daily question] a single element in an ordered array
0 basic learning C language - nixie tube dynamic scanning display
Pyrethroid pesticide intermediates - market status and future development trend
Remember a lazy query error
Maximum likelihood method, likelihood function and log likelihood function
QML add gradient animation during state transition
Sequence sorting of basic exercises of test questions
C import Xls data method summary IV (upload file de duplication and database data De duplication)
Jerry's synchronous weather information to equipment [chapter]
Cancer biopsy instruments and kits - market status and future development trends