About DB2SQL

SELECT A.VA_REGION_NAME AS AREA_NAME, A.VA_CIG_TRADEMARK AS CIG_NM, B.DE_BS_CXB AS CXB_REL, A.DE_BS_CXB_PRE AS CXB_PRE
FROM DCDW.FAC_SCC_ZY_REGION_CXB_PRE A
LEFT JOIN DCDW.FAC_SCC_ZY_REGION_CXB B
ON B.VA_CIG_TRADEMARK = A.VA_CIG_TRADEMARK AND A.VA_REGION_CODE = B.REGION_CODE
LEFT JOIN DIM_REGION C
ON A.VA_REGION_CODE = B.REGION_CODE = C.PROV_CODE OR A.VA_REGION_CODE = B.REGION_CODE = C.AREA_CODE

Execute the SQL statement in

DB2, always report an error and find the exception tag "= C" after "CODE = B.REGION_CODE".
check it out, ask God to tell

Jan.03,2022

The ON statement after

LEFT JOIN DIM_REGION C is written as follows:
A.VA_REGION_CODE = B.REGION_CODE = C.PROV_CODE

it is grammatically wrong to write this way, and there can only be one equal sign comparison.

I understand that A.VA_REGION_CODE = B.REGION_CODE has already been written when Table An is associated with Table B and should be removed, so the statement after LEFT JOIN DIM_REGION C should be:

LEFT JOIN DIM_REGION C 
ON B.REGION_CODE = C.PROV_CODE OR B.REGION_CODE = C.AREA_CODE
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eadd29-2188.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eadd29-2188.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?