风动破

导航

第四章 求差集-minus 运算

返回第一个集合中存在,而第二个集合不存在的记录
select * from staff
minus
select * from staff_copy;
mysql不支持,需要通过自己实现
select a.id,a.name from staff a
LEFT JOIN staff_copy b
on a.id=b.id
where a.name!=b.name;

posted on 2015-04-27 17:08  风动破  阅读(96)  评论(0)    收藏  举报