1. union calculation selectnamefromtest1union [all] selectnamefromtest2; when union is used, results are sorted by default, while unionall is not
1. The union operation select name from test1 union [all] select name from test2; when union is used, results are sorted by default, and union all is not
1. Union Operation
Select name from test1
Union [all]
Select name from test2;
When union is used, results are sorted by default, and union all is not sorted, which consumes less resources. However, union all does not perform deduplication ~
2. intersection calculation
Select name from test1
Intersect
Select name from test2;
Oracle does not support the Intersect all keyword!
3. Difference Calculation
Select name from test1
Minus
Select name from test2;
The difference calculation in Oracle is different from the SQL standard. In the SQL standard, we use the following functions for the difference calculation.
Select name from test1
Counter T [all]
Select name from test2;