我有两张桌子
在oreg表中,我对字段ora_warranty_id有一些空值,但是在MSK表中我没有空值,所以当我加入这两个表时,oreg的空值列被过滤,有没有办法可以限制数据也是如此。我在下面做了qry,但不确定这是否正确。
select *
from
(
select
oreg.ora_warranty_id,
mdh.warranty_sku_num
from
mdhdba.m_warranty_sku mdh
, xx_new.xx_online_registrations@appsread.prd.com oreg
where
mdh.warranty_sku_num= oreg.ora_warranty_id(+) -----ora_warranty_id from xx_new.xx_online_registration table
)
where ora_warranty_id is null -- oreg.ora_warranty_id
答案 0 :(得分:0)
希望这有帮助,
select *
from
(
select
oreg.ora_warranty_id,
mdh.warranty_sku_num
from
mdhdba.m_warranty_sku mdh
, xx_new.xx_online_registrations@appsread.prd.com oreg
where
oreg.ora_warranty_id = mdh.warranty_sku_num(+) -----ora_warranty_id from xx_new.xx_online_registration table
)
where ora_warranty_id is null -- oreg.ora_warranty_id