SQL format execution sequence of oracle data structure and sequence number of SQL query processing, oraclesql
I. execution sequence of SQL format
FROM-> WHERE-> group by-> HAVING-> SELECT-> ORDER
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. select fields;
8. Use order by to sort the result set.
Unlike other programming languages, SQL is most characteristic of code processing. In most database languages, codes are processed in the encoding order. However, in an SQL statement, the first clause to be processed is FROM, rather than the first SELECT statement to appear. Sequence Number of the SQL Query Process:
1 (8) SELECT (9) DISTINCT (11)
2 (1) FROM
3 (3) JOIN
4 (2) ON
5 (4) WHERE
6 (5) GROUP
7 (6) WITH {CUBE | ROLLUP}
8 (7) HAVING
9 (10) ORDER
Each of the preceding steps generates a virtual table, which is used as the input for the next step. These virtual tables are unavailable to callers (client applications or external queries. Only the table generated in the last step will be sent to the caller. If a clause is not specified in the query, the corresponding steps are skipped.