交集:Intersect
select customer_id,key_,value_ from t_customer_contact_bak ccc
intersect
select customer_id,key_,value_ from t_customer_contact ccc
差集:MINUS (SqlServer中使用except关键字)
select customer_id,key_,value_ from t_customer_contact_bak ccc
MINUS
select customer_id,key_,value_ from t_customer_contact ccc
并集:Union
--去重
select customer_id,key_,value_ from t_customer_contact_bak ccc
Union
select customer_id,key_,value_ from t_customer_contact ccc
select customer_id,key_,value_ from t_customer_contact_bak ccc
Union All
select customer_id,key_,value_ from t_customer_contact ccc
2019年第一篇博文,好的开始,加油!