The complete execution sequence of the SQL SELECT statement:
1. The from clause assembles data from different data sources;
2. The WHERE clause filters record rows based on specified conditions;
3. The group by clause divides data into multiple groups;
4. Use Aggregate functions for computation;
5. Use the having clause to filter groups;
6. Calculate all expressions;
7. Use order by to sort the result set.
What's worse, it's not mentioned.
The keyword "select. I discussed it with my classmates and thought it should be executed at the end, because I thought it was necessary to wait until the execution of all the conditions was complete and then retrieve the data -- but I didn't find any definite evidence.
Data. Today, I discussed this with another female. Indeed, the female is very careful. She gave other comments on "select. So I also began to shake it, Because orderby is to judge
Does the SELECT statement contain any field after orderby. At this time, the Chinese search can only find the above content, so you have to use the English search, the Search Keyword: SQL Execute
Order:
- From clause
- Where clause
- Group by clause
- Having clause
- Select clause
- Order by clause
I think this is a reasonable answer.