日期:2014-05-17 浏览次数:20905 次
select B.* from A,B where A.cardid=B.cardid and A.cardid=? union all select C.* from A,C where A.cardid=C.cardid and A.cardid=?
------解决方案--------------------
select a.* from a right outer join b on a.cardid=b.cardid
right outer join c on a.cardid=c.cardid
------解决方案--------------------
create view vw_view as select cardid ,col2,col3 from man
union all
select cardid ,col2,col3 from car
union all
select cardid ,col2,col3 from card t
where not exists(select 1 from man a where a.cardid=t.cardid)
and not exists(select 1 from car a where a.cardid=t.cardid)
这样?