Oracle
 sql >> Datenbank >  >> RDS >> Oracle

Aufgrund des Nullwerts werden die Daten nicht reflektiert

Verwenden Sie stattdessen Left Join. Left Join ist nicht strikt und wird auch dann angezeigt, wenn keine Daten zu verbundenen Parteien vorhanden sind.

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';