用Left Join试试select pub_vendor.* ,pub_base_no.base_name,org_enterprise.com_name
from pub_vendor A
Left Join org_enterprise B On A.inner_com_id=B.com_id
Left Join pub_base_no C On C.base_id = A.trades_id
where C.base_type = 'trades_id' and
and A.vendor_id =?
from pub_vendor A
Left Join org_enterprise B On A.inner_com_id=B.com_id
Left Join pub_base_no C On C.base_id = A.trades_id
where C.base_type = 'trades_id' and
and A.vendor_id =?
from
( select a.* ,b.base_name
from pub_vendor as a FULL OUTER JOIN pub_base_no as b
on a.trades_id = b.base_id and b.base_type = 'trades_id' where a.vendor_id = ? ) as c LEFT OUTER JOIN org_enterprise as d
on d.com_id= c.inner_com_id