当前位置:网站首页>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 :
边栏推荐
- I don't know why it can't run in the project and how to change it
- Jerry's modification setting status [chapter]
- Applet graduation project based on wechat selection voting applet graduation project opening report function reference
- Some other configurations on Huawei's spanning tree
- Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?
- MySQL utilise la vue pour signaler les erreurs, Explicit / show ne peut pas être publié; Verrouillage des fichiers privés pour la table sous - jacente
- 2022 electrician (elementary) examination question bank and electrician (elementary) simulation examination question bank
- The difference between lambda expressions and anonymous inner classes
- Bacteriostatic circle scanning correction template
- Install the pit that the electron has stepped on
猜你喜欢

TP5 automatic registration hook mechanism hook extension, with a complete case

Force buckle day32

Maximum likelihood method, likelihood function and log likelihood function

2020-12-02 SSM advanced integration Shang Silicon Valley

How programmers find girlfriends through blind dates

Conditional test, if, case conditional test statements of shell script

Will the memory of ParticleSystem be affected by maxparticles

What are the advantages and disadvantages of data center agents?

Use classname to modify style properties

Some other configurations on Huawei's spanning tree
随机推荐
Description of setting items of Jerry [chapter]
MySQL - use of aggregate functions and group by groups
Idsia & supsi & usi | continuous control behavior learning and adaptive robot operation based on Reinforcement Learning
Related configuration commands of Huawei rip
How to use AHAS to ensure the stability of Web services?
Jerry's synchronous weather information to equipment [chapter]
Stringutils and collectionutils
Functions and arrays of shell scripts
ThinkPHP uses redis to update database tables
Jerry's modification setting status [chapter]
求esp32C3板子連接mssql方法
IPv6 experiment
2022 R2 mobile pressure vessel filling certificate examination and R2 mobile pressure vessel filling simulation examination questions
Hamburg University of Technology (tuhh) | intelligent problem solving as integrated hierarchical reinforcement learning
Setting function of Jerry's watch management device [chapter]
Méthode de calcul de la connexion MSSQL de la carte esp32c3
Lightweight Pyramid Networks for Image Deraining
The contact data on Jerry's management device supports reading and updating operations [articles]
Introduction to Tianchi news recommendation: 4 Characteristic Engineering
Trading software programming