SELECT query statement and all its clauses
Sequential Number |
Clause keywords |
Sub-sentence skill |
1 |
Select |
Extracts data from the specified column from the specified table |
2 |
From |
Table to be queried |
3 |
Where |
Specifies the criteria for selecting a query. |
4 |
Group |
Grouping result sets, often used together with aggregate Functions |
5 |
Having |
Returns the number of rows in the selected result set. |
6 |
Order |
Search criteria of the specified group |
If some query clauses shown in Table 8-2 are used in the same SELECT query statement, the query clauses are sorted in ascending order according to their sequence numbers. Therefore, the complete SELECT query statement can be expressed:
Select select_list
From table_source
[Where search_condition]
[Group by group_by_expression]
[Having search_condition]
[Order by order_expression [ASC | DESC]
The part in [] is optional.