In the query statement, select from where group by having order by is executed in sequence 1. the query mainly contains six keywords, and their order is select -- from -- where -- group by -- having -- order by, where select and from are required, other keywords are optional. The execution sequence of these six keywords is not the same as that of SQL statements, instead, execute from -- where -- group by -- having -- select -- order by in the following order, from: the data table from which to retrieve data where: filter the data condition group: how to group the data that has been filtered out above having: filter the data that has been grouped above the condition select: view which column in The result set, or the calculation result order by of the column: view the returned data in what order. 2. table association after from, which is from the right The resolution order of the where condition is bottom-up. That is to say, when writing SQL files, try to put tables with a large amount of data on the rightmost side for association, and put the conditions that can filter out a large amount of data at the bottom of the where statement.