Home> Database> SQL> body text

What is the priority of SQL statement execution order?

烟雨青岚
Release: 2020-07-01 09:44:34
Original
22803 people have browsed it

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!

Related labels:
sql
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!