Oracle
 sql >> Database >  >> RDS >> Oracle

A causa del valore nullo, i dati non si riflettono

Usa invece il join sinistro. left join non sarà rigido e verrà comunque visualizzato anche se non ci sono dati sulla parte correlata.

select distinct 
  vsor.shipment_gid,
  vsor.order_release_gid,
  orem1.remark_text as Related_Party,
  orem2.remark_text as ULTIMATE_CONSIGNEE_TYPE,
  orem3.remark_text as CONSIGNEE_TYPE
from view_shipment_order_release vsor
LEFT JOIN  order_release_remark orem1
ON  orem1.REMARK_QUAL_GID ='GECORP.CONSIGNEE TYPE'
 and orem1.order_release_gid=vsor.order_release_gid
  LEFT JOIN order_release_remark orem2
  ON orem2.REMARK_QUAL_GID ='GECORP.RELATED PARTY'  
  and orem2.order_release_gid=vsor.order_release_gid
  LEFT JOIN order_release_remark orem3 
 ON orem3.REMARK_QUAL_GID ='GECORP.ULTIMATE CONSIGNEE TYPE'
and orem3.order_release_gid=vsor.order_release_gid
where vsor.shipment_gid='GECORP.101027274';