Home >Database >SQL >What is the priority of SQL statement execution order?

What is the priority of SQL statement execution order?

烟雨青岚
烟雨青岚Original
2020-07-01 09:44:3422935browse

SQL execution order priority from high to low is: the statement after the from keyword, the statement after the where keyword, the statement after "group by", the statement after select, and the statement after "order by" statement.

What is the priority of SQL statement execution order?

What is the priority of SQL statement execution order?

This statement contains some keywords we often use, select, from, where, group by, order by, its execution sequence is as follows:

First execute the statement after the from keyword to clarify the source of the data and which table it is taken from.

Then execute the statement following the where keyword to filter the data.

Then execute the statements following group by to group and classify the data.

Then execute the statement following select, that is, which part of the processed data should be taken.

Finally execute the statement following order by to sort the final results.

Recommended tutorial: "sql video tutorial"

The above is the detailed content of What is the priority of SQL statement execution order?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is SQL InterfaceNext article:What is SQL Interface