我是SQL新手,只知道基礎知識。如果有人能幫助下面的查詢,我將不勝感激。這將返回字段具有值的所有值,但是對於LO.Filurecode,需要返回該值時存在空值以及識別並填充缺失值。任何人都可以幫助看到下面的酷兒。在查詢中使用多個表返回空值
alter session set current_schema=maximo;
select
l.location,
l.description,
l.siteid,
l.type,
l.status,
lh.parent,
lo.failurecode,
lo.locpriority,
L.PLUSGSAFETYCRIT,
L.PLUSGENVCRIT,
L.PLUSGCOMCRIT,
L.PLUSGEXREGISTERED,
l.ta,
l.taqamanufacturer,
l.modelnum,
l.PLUSGLOCREFERENCE,
l.PLUSGPHYSLOC
from
locations l, lochierarchy lh, locoper lo
where
l.location = lh.location
and l.location = lo.location
and l.siteid = lo.siteid
and l.siteid = lh.siteid
and l.type ='OPERATING'
and lh.systemid ='PRIMARY'
and l.siteid ='COA'
order by location
用戶爲此目的左或右外部加入....這將給你空白數據以及.. – DeDevelopers 2014-09-30 09:29:27