你的那样用法肯定不行,只能换种方法select * from Urge A join OweDom_Sub B on A.lSubID=B.lID 
    join RentContract C on B.sCntID=C.sContractID where A.lMID=0
union all
select *  
from Urge D join OweDom E on D.lMID=E.lID join RentContract F on E.sCntID=F.sContractID
where D.lMID<>0

解决方案 »

  1.   

    join和case一齐,是什么意思?--这样用可以.
    select * from A where a=case when exists(select 1 from a join b on a.id=b.id) then 'abc' else '0' end
      

  2.   

    select *
    from Urge join OweDom_Sub on Urge.lSubID=OweDom_Sub.lID and Urge.lMID=0
    join OweDom on Urge.lMID=OweDom.lID where Urge.lMID<>0
    join RentContract on OweDom.sCntID=RentContract.sContractID