0

次のクエリを実行しようとしましたが、次のエラーがスローされました。

ORA-00911: 無効な文字です

select 
sum(coalesce(decode(FKTD_DR_CR_TYPE,'1',FKTD_NRS_AMOUNT,0),0)) as DEBIT_AMOUNT,
sum(coalesce(decode(FKTD_DR_CR_TYPE,'0',FKTD_NRS_AMOUNT,0),0)) as CREDIT_AMOUNT 
from FMS_KS_TRANS_DTL 
inner join FMS_KS_TRANS_MST 
    ON FMS_KS_TRANS_MST.FKTM_TRANS_MST_ID = FMS_KS_TRANS_DTL.FKTD_TRANS_MST_ID 
inner join FMS_FC_VOUCHER_CONFIG 
    ON FMS_FC_VOUCHER_CONFIG.FFVC_VOUCHER_ID = FMS_KS_TRANS_MST.FKTM_VOUCHER_ID 
where FFVC_ACCOUNT_TYPE = 5 and FKTM_FISCAL_YEAR='2066/67'
and FKTD_ACC_ID in 
(
    select FFAM_ACC_ID from FMS_FC_ACC_MST
    where ffam_group_flag = 2 and FFAM_FISCAL_YEAR='2066/67'
    start with ffam_acc_id in 
    (
        select distinct FKP_CASH_ACC_ID from FMS_KS_PARAMETER 
        where FKP_FISCAL_YEAR='2066/67'
    )
    connect by ffam_group_flag = 2 
    and prior ffam_acc_id = ffam_upper_acc_id;
    /*
      This sub query executes fine if executed separately 
      and this whole query block executes fine if 
      this hierarchical query is not used.
    */
)       
4

2 に答える 2

2

コメントされたクエリの前のセミコロン?

于 2013-03-04T09:08:49.153 に答える
1

サブクエリは、;

select 
sum(coalesce(decode(FKTD_DR_CR_TYPE,'1',FKTD_NRS_AMOUNT,0),0)) as DEBIT_AMOUNT,
sum(coalesce(decode(FKTD_DR_CR_TYPE,'0',FKTD_NRS_AMOUNT,0),0)) as CREDIT_AMOUNT 
from FMS_KS_TRANS_DTL 
inner join FMS_KS_TRANS_MST 
    ON FMS_KS_TRANS_MST.FKTM_TRANS_MST_ID = FMS_KS_TRANS_DTL.FKTD_TRANS_MST_ID 
inner join FMS_FC_VOUCHER_CONFIG 
    ON FMS_FC_VOUCHER_CONFIG.FFVC_VOUCHER_ID = FMS_KS_TRANS_MST.FKTM_VOUCHER_ID 
where FFVC_ACCOUNT_TYPE = 5 and FKTM_FISCAL_YEAR='2066/67'
and FKTD_ACC_ID in 
(
    select FFAM_ACC_ID from FMS_FC_ACC_MST
    where ffam_group_flag = 2 and FFAM_FISCAL_YEAR='2066/67'
    start with ffam_acc_id in 
    (
        select distinct FKP_CASH_ACC_ID from FMS_KS_PARAMETER 
        where FKP_FISCAL_YEAR='2066/67'
    )
    connect by ffam_group_flag = 2 
    and prior ffam_acc_id = ffam_upper_acc_id
);

他に何か問題がない限り、うまくいくはずです(セミコロンを移動しました):-)

于 2013-03-04T09:16:07.997 に答える