The complete syntax of the select statement is: SELECT DISTINCT <select_list> FROM <left_table> <join_type> JOIN <right_table> ON <join_condition> WHERE <where_condition> GROUP BY <group_by_list> HAVING <having_condition> ORDER BY <order_by_condition> LIMIT <limit_number> Execution order: from →join →on →where →group by →having →select →order by →limit (1) The role of each keyword: from: From which data table do you want to retrieve data? If there is a join, perform a Cartesian product (cross join) on the first two tables in the FROM clause to generate a temporary table (n×m rows) on: Conditionally filter the above temporary tables left/right (join): Supplement the left or right table to keep it complete. If there are multiple associated tables, the intermediate table continues the above two steps for the next table.
sum: aggregate function
distinct:
(2) The difference between on and where:
(3) The difference between having and where:
(4) Usage of count When using count(column name) and a null value appears in a column, count(*) will still be calculated, but count(column name) will not. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: After Webpack-cli is successfully installed, check the webpack -v error case for details
>>: A brief discussion on how to modify/set the environment variable JAVA_HOME under Linux
Installation Steps 1. Install Redis Download the ...
Beautiful code is the foundation of a beautiful we...
Table of contents Binding Class Binding inline st...
There are two common ways to make div background ...
Today I installed the MySQL database on my comput...
introduction If you are familiar with using JDBC ...
HTML tags have special tags to handle the title of...
CPU Load and CPU Utilization Both of these can re...
CSS CodeCopy content to clipboard .bottomTable{ b...
When you send a network request, the following sa...
1. Time types are divided into: 1. Network time (...
ElasticSearch cluster supports動態請求的方式and靜態配置文件to ...
1. Use the transform attribute to display the ima...
This article briefly introduces the relationship ...
Table of contents Preface Style Function Descript...