1. When you use the Where, group BY, and having clauses in a SELECT statement, they function and execute in the following order:
(1) Where is used to filter the data object specified by from
(2) Group by for grouping the results of the Where
(3) is used to filter the data after group by grouping
2, the difference between count (*) and COUNT (Columnname|columnindex):
COUNT (*) is counted as null in the table, and Count (Columnname|columnindex) ignores the null record for the corresponding field.
3. There are four main types of connections specified by the JOIN keyword: INNER join, left outer join, right outer join, and full outer join.
(1) Inner JOIN is an internal connection, is the system default connection, you can omit the inner, it will all meet the conditions of the records listed.
(2) A LEFT outer join is an outer join, in which outer can be omitted, which includes all the rows of the left table in addition to the records that satisfy the criteria.
(3) Right outer join is a right-hand outer join in which outer can be omitted, except to list all the records that meet the criteria, including all rows of the right table.
(4) The full outer join is an all outer join in which outer can be omitted, which includes all the rows of the left table and right tables in addition to the records that satisfy the criteria.
4, the Union clause in select
Use the Union clause to combine two or more query results into one result set. The syntax format is as follows:
(query expression) union [all] (query expression) [union [all] (query expression)]
--use keyword all to indicate that all rows are included in the merged result set, that duplicate rows are not removed, and duplicates are removed without using the ALL keyword.
The basic rules for using Union are:
(1) The number of columns and the order of columns must be the same in all queries
(2) The data type of the corresponding column must be compatible
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/