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