The format of the statement we wrote is as follows:
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 >
The MySQL execution sequence is as follows:
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>
Although, the SELECT
statement we wrote is the first, but in the execution order of MySQL, the FROM
statement executed first .
The graphical display is as follows: