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

What is the priority of SQL statement execution order?

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

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 thefrom keywordto clarify the source of the data and which table it is taken from.

Then execute the statement following thewhere keywordto filter the data.

Then execute the statements followinggroup byto group and classify the data.

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

Finally execute the statement followingorder byto 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 Interface Next article:What is SQL Interface