我正在使用此查询来获取结果,
SELECT *
FROM TRXN_REPORT CNT,
TBL_CUSTINFO CUSTADDINFO,
TBL_DEAL_EVT EVENT,
TBL_MISCADDR CIFMISC
WHERE CNT.INTERNAL_REF_NUM = EVENT.INTERNAL_REF_NUM
AND CNT.BRANCH = EVENT.BRANCH
AND CNT.QFXVERSION = EVENT.QFXVERSION
AND CNT.VALUEDATE = EVENT.VALUEDATE
AND CNT.LIQ_STATUS = 'L'
AND EVENT.EVENTCODE = 'LLIQ' -- Liquidation Event
AND CUSTADDINFO.CUSTOMER_NO = CNT.CUST_NUM
AND CIFMISC.CUSTOMER_NUMBER = CNT.CUST_NUM
AND CUSTADDINFO.REC_STATUS ='O'
AND CIFMISC.REC_STATUS = 'O'
AND MY_PBG_CUSTOMER = 'Y'
AND (BUYCCYCODE = 'USD' OR SELLCCYCODE ='USD')
这里这个条件
和 CIFMISC.CUSTOMER_NUMBER = CNT.CUST_NUM
只获取那些同时存在于TBL_MISCADDR
和TRXN_REPORT
表中的记录,现在作为要求的改变,我想执行左外连接,以便获取TBL_MISCADDR
表中不存在但存在于TRXN_BATCHREPORT_WRK
. 如何在保持所有 where 条件的同时执行此操作。