0

我有这样的查询..

SELECT    
sum(wms_trx."trans_net_amt") as "TRANS_AMT_FCY",
    wms_trx."trans_type_cd",
    CASE WHEN "trans_type_cd" IN (SELECT "ref_value" FROM "B_VIRTUAL"."man_upload_ref")
        THEN '1' ELSE '0' END as "IS_FIN_TRANS_FLAG"
    FROM "B_VIRTUAL"."sor_wms_trx" AS wms_trx
    WHERE wms_trx."batch_date" = '20190501'
    GROUP BY wms_trx."trans_type_cd", 'IS_FIN_TRANS_FLAG'

但是当我执行它时,我得到了这样的错误

无法在 535 ms 609 µs 内执行 'SELECT sum(wms_trx."trans_net_amt") as "TRANS_AMT_FCY", wms_trx."trans_type_cd", CASE WHEN ...'。
SAP DBTech JDBC:[403]:内部错误:为远程数据库打开游标时出错编译语句时出错:FAILED:ParseException line 1:159 missing)在表源中“trans_type_cd”附近的“V1”处
第 1:196 行无法识别表源中 'V2' 'FROM' 'sor' 附近的输入,用于查询 "SELECT "sor_man_upload_ref1"."V1", "sor_man_upload_ref1"."V2", "sor_man_upload_ref2"."V1" FROM ( ( SELECT SUM("WMS_TRX"."trans_net_amt") AS "V1", "WMS_TRX"."trans_type_cd" AS "V2" FROM """sor"".""sor_wms_trx""""WMS_TRX" WHERE "WMS_TRX"。 batch_date" = '20190501' GROUP BY "WMS_TRX"."trans_type_cd" ) "sor_man_upload_ref1" 左外连接 (SELECT "sor_man_upload_ref"."ref_value" AS "V1" FROM """sor"".""sor_man_upload_ref""""sor_man_upload_ref" GROUP BY "sor_man_upload_ref"."ref_value" ) "sor_man_upload_ref2" ON ("sor_man_upload_ref1"."V2" = "sor_man_upload_ref2"."V1") ) "

请帮助我...谢谢

4

0 回答 0