Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 4 tables: A, B, C and D, all have been loaded as QVD, I would like to make another table that reproduces the following query from the QVD already mentioned:
SELECT
D.portfoliocode_,
A.COD_GEST,
A.COD_INVEST_ADM,
A.COD_CLI,
A.AMT_FLAG_DEL,
A.DES_NME,
A.COD_CGC,
B.DAT_LIQ,
B.DAT_LANC,
B.DES_TYP,
C.DES_LAN,
B.DES_HIST,
B.AMT_VAL,
B.COD_REC_DESP,
B.COD_ACTV,
B.COD_ORIG,
B.COD_FLAG_LIQ
FROM A
INNER JOIN B
ON A.COD_CLI = B.COD_CLI
INNER JOIN C
ON C.COD_LAN = B.DES_TYP
LEFT JOIN D
ON (D.managercode_ = A.COD_GEST OR D.administratorcode_ = A.COD_INVEST_ADM)
My only question is to perform the "LEFT JOIN" with the "OR" conditional, could someone share an example?
It's not possible in this (sql) way because all the joins are always only performed on identically field-names. This means you may need to apply one or multiple actions like:
- Marcus