The execution order of sql and mysql, the internal mechanism is the same, the biggest difference is in the alias
mysql execution order
1, from
2, on
3, join
4, where
5, group by (start using the alias in select, and you can use it in subsequent statements )
6, avg, sum.....
7, having
8, select
9, distinct
10. Order by
Recommended tutorial: mysql video tutorial
The above is the detailed content of What is the priority of mysql query statements?. For more information, please follow other related articles on the PHP Chinese website!