当前位置:网站首页>MySQL - the execution order of an SQL statement

MySQL - the execution order of an SQL statement

2022-06-12 19:50:00 WD Technology

sql sentence :

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> 

Machine reading :

FROM <left_table>
ON <join_condition>
<join_type> JOIN <right_table>
WHERE <where_condition>
GROUP BY <group_by_list>
HAVING <having_condition>
SELECT DISTINCT <select_list>
ORDER BY <order_by_condition>
LIMIT <limit_number> 

The order :
from: Which data table to retrieve data from
where: Conditions for filtering data in a table
group by: How to group the data filtered above
having: The conditions for filtering the grouped data above
select: See which column in the result set , Or column
order by : In what order to view the returned data

Add :
https://www.cnblogs.com/cdf-opensource-007/p/6502556.html

原网站

版权声明
本文为[WD Technology]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202281534381678.html