b.flag,c.flag为b,c表中的其他一个字段select a.id,decode(b.flag,null,decode(c.flag,null,'a not in b and c','a in c'),'a in b')
from a,b,c
where a.id = b.id(+)
and a.id = c.id(+)
from a,b,c
where a.id = b.id(+)
and a.id = c.id(+)
union all
select 'c',a.* from a,c where a.id = c.id
union all
select 'c',a.* from a,c where a.id = c.id
最好的实现你的功能。
1楼的速度很慢。