当前位置:网站首页>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 :
边栏推荐
- 2022 electrician (elementary) examination question bank and electrician (elementary) simulation examination question bank
- Small program graduation project based on wechat examination small program graduation project opening report function reference
- Use classname to modify style properties
- Hbuilder link Xiaoyao simulator
- Do you know the eight signs of a team becoming agile?
- Solution to the problem that jsp language cannot be recognized in idea
- Setting function of Jerry's watch management device [chapter]
- Small program graduation design is based on wechat order takeout small program graduation design opening report function reference
- Jerry's modification setting status [chapter]
- Why can't it run (unresolved)
猜你喜欢

Ka! Why does the seat belt suddenly fail to pull? After reading these pictures, I can't stop wearing them

Force buckle day32

How to use AHAS to ensure the stability of Web services?

What are the advantages and disadvantages of data center agents?

Avoid playing with super high conversion rate in material minefields

Write the first CUDA program

MySQL deadly serial question 2 -- are you familiar with MySQL index?

How programmers find girlfriends through blind dates

Solution of cursor thickening

Chapter 3.4: starrocks data import - Flink connector and CDC second level data synchronization
随机推荐
Small program graduation project based on wechat video broadcast small program graduation project opening report function reference
Cancer biopsy instruments and kits - market status and future development trends
When the watch system of Jerry's is abnormal, it is used to restore the system [chapter]
Introduction to Tianchi news recommendation: 4 Characteristic Engineering
Example 073 square sum value judgment programming requires the input of a and B, if a ²+ b ² If the result of is greater than 100, a is output ²+ b ² Value, otherwise output the result of a + B.
Experimental animal models - current market situation and future development trend
IPv6 experiment
Meta metauniverse female safety problems occur frequently. How to solve the related problems in the metauniverse?
Introduction to graphics: graphic painting (I)
How to use AHAS to ensure the stability of Web services?
[leetcode daily question] a single element in an ordered array
What are the advantages and disadvantages of data center agents?
Huawei cloud micro certification Huawei cloud computing service practice has been stable
Flex flexible layout, box in the middle of the page
Jerry's watch information type table [chapter]
Méthode de calcul de la connexion MSSQL de la carte esp32c3
Pytoch residual network RESNET
Life cycle of instance variables, static variables and local variables
Software product download collection
Mongodb learning notes: command line tools