Mysql execution order keyword

Keywords used in the query contains six main, and their order was
select-from-where-group by -having-order by
which select from and is a must, other keywords are optional, six keywords execution order
and the order of writing sql statement is not the same, but is performed in the following order
from Group-by-WHERE HAVING-by-SELECT-order,
from: which need to retrieve data from the data table
where: filter the data in table condition
group by: how the above filter out data packets
having: conditions above have packet data filtering
select: see which column in the result set, or calculated column result
order by: according to what order to view the data returned

Published 14 original articles · won praise 2 · Views 813

Guess you like

Origin blog.csdn.net/breakaway_01/article/details/102636671