Database principle-select Statement complete syntax

Source: Internet
Author: User
2018-1-9 by Atlas

  • The complete syntax of the SELECT statement, in syntax [] indicates that the component may or may not be available.

SELECT <目标表的列名或列表表达式序列>FROM <基本表名和(或)视图序列>[WHERE <行条件表达式>][GROUP BY <列名序列>        [HAVING <组条件表达式>]][ORDER BY <列名 [ASC|DESC]>,...]

The entire statement is executed as follows:
(1) Read the data from the base table and view in the FROM clause and perform a Cartesian product operation.
(2) Select the tuple that satisfies the conditional expression given in the WHERE clause.
(3) Group by the value of the specified column in the group clause, while extracting those groups that satisfy the group condition expression in the HAVING clause.
(4) evaluates the output by the column name or list expression given in the SELECT clause.
(5) The order clause sorts the target table of the output, ASC ascending by additional description, or in descending order of Desc.
In a SELECT statement, the WHERE clause is called a row conditional clause, and the group clause is called a grouping clause. The HAVING clause is called a group conditional clause, and the order clause is called a sort clause.

Excerpt from: "Principles of Database System"

Database principle-select Statement complete syntax

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.