9.2、并集运算
UNION运算符返回两个集合去掉重复元素后的所有记录
UNION ALL运算符运算符返回两个集合所有记录,不去除重复的元素;
语句:
select * from t_owners where id<=7
union all(或者 union)
select * from t_owners where id>=5;
9.3、交集运算
INTERSECT运算符返回同时属于两个集合的记录;
语句:
select * from t_owners where id<=7
intersect
select * from t_owners where id>=5;
9.4、差集运算
MINUS返回属于第一个集合但不属于第二个集合的记录
语句:
select * from t_owners where id<=7
minus
select * from t_owners where id>=5;