[Quote=引用 9 楼 oraclers 的回复:]
或者:
select *
from (select b.* from b union select c.* from c) q join a on a.yhid=q.yhid
where a.yhid=1
[/Quote]
select q.*
from (select b.* from b union select c.* from c) q join a on a.yhid=q.yhid
where a.yhid=1
select * from b where yhid in(select yhid from b union select yhid from c)
union
select * from c where yhid in(select yhid from b union select yhid from c)
select * from b where yhid in ((select yhid from b) intersect (select yhid from c))
union
select * from c where yhid in ((select yhid from b) intersect (select yhid from c))