我在使此查询正常工作时遇到问题,我实际上是在尝试同时使用 OR 和 AND 运算符,但似乎无法弄清楚为什么会出现此错误的问题“:"expecting
绝对'或ACTION' or
添加'或ALL' or
更改' “`。这是我的sql代码:
SELECT *
FROM EDXW ED, TRANSACTION TXN
WHERE ED.LAM_BK like 'TAR%'
AND ED.KEY = TXN.KEY
AND substring(ED.JAM_BK from position('~' in ED.JAM_BK) + 1) = TXN.EBS_ID
(AND ED.CLS_CD IN ('WIS','OP','OPP')
AND TXN.REV_CD IN ('0360','0361')
AND TXN.LS_CTR_CD IN ('548000','552000','552500','553000','553500','554000','555000','555500','558000')
AND ED.SITE_CD = 'X' )
OR
( ED.ED_CLS_CD IN ('WIS','OP','OPP')
AND AND TXN.REV_CD IN ('0350','0311')
AND AND TXN.LS_CTR_CD IN ('548000','558300')
AND LOC.ED_SITE_CD = 'M')
OR
( ED.ED_CLS_CD IN ('WIS','OP','OPP')
AND AND TXN.REV_CD IN ('0350','0311')
AND AND TXN.LS_CTR_CD IN ('549000','557300')
AND LOC.ED_SITE_CD IN ('M','K'));