Oracle中交集 INTERSECT 的使用

2014-11-24 18:49:25 · 作者: · 浏览: 1

intersect运算 
返回查询结果中相同的部分 
exp:查询两个人的共同好友,表 org_optor_friends 为好友表。
select friend_id from org_optor_friends f1 where f1.optor_id='ligp' and status='1'


intersect


select friend_id from org_optor_friends f2 where f2.optor_id='shangtao' and status='1'