[SQL]
<Span style = "font-size: 18px;"> </span>
[SQL]
<Span style = "font-size: 18px;"> set operator: UNION/union all union set, INTERSECT intersection, MINUS difference set
1. union is used to calculate the union. The public part only contains one
For example, find that the name of the emp table contains 'A' or 'M'
SQL> select * from emp where ename like '% A %'
2 union
3 select * from emp where ename like '% M % ';
2. union all calculates the union, and the public part only contains the secondary
For example, find that the name of the emp table contains 'A' or 'M'
SQL> select * from emp where ename like '% A %'
2 union all
3 select * from emp where ename like '% M % ';
3. Intersection of intersect values, including only the public part
For example, find that the name of the emp table contains 'A' and 'M'
SQL> select * from emp where ename like '% A %'
Intersect
Select * from emp where ename like '% M % ';
4. minus calculates the difference set and obtains set A to remove the intersection of set A and Set B.
Example: Evaluate the emp table sal from 700 to 1200
SQL> select * from emp where sal between 700 and 1300
Minus
Select * from emp where sal between 1200 and 1400;
</Span>
From song lixing's column