Order of execution of keywords in sql

Source: Internet
Author: User

As a novice SQL, see each unfamiliar keyword is enough to be confused, can often see the sentence keyword order is still various, too difficult to understand. Online search of two articles, summed up:

About SQL keyword Select from GROUP order and so on execution order question explanation

Order of execution of SELECT statements in SQL

And ten steps to fully understand SQL step two.

Summarize:

The parsing order of standard SQL is:
(1). FROM clause, assemble data from different data sources

    • Includes various join and on

(2). WHERE clause to filter records based on specified criteria
(3). GROUP BY clause, dividing data into multiple groupings

    • including using aggregate functions for calculations

(4). Use the HAVING clause to filter the grouping
(5). Select Select some columns of the final result
(6). Use order by to sort the result set

 

Order of execution of keywords in sql

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.