insert into T_CLEAR_FEEORDER (id,merno,Tranamt,Trannum,FEETYPE)select seq_clear_id.nextval,
a.MERNO,
a.TRANSFEEsum,
a.cnt,
SUBSTR(c.ACC_DATE, 0, 6),
'0',
b.RESERVACCTID,
d.merstlbook
from (SELECT MERNO,
CAPCHANNELNO,
NVL(sum(TRANSFEE), '0.00') TRANSFEEsum,
count(*) cnt
from T_CLEAR_TRANSORDER
--where transdate like :acc_date and feesubtype = '02'
group by (merno, CAPCHANNELNO)) a,
"View_T_PAY_FUNDCHN_INFO" b,
t_daily_info c,
T_CLEAR_MERCLEAR_BOOK d
where a.CAPCHANNELNO = b.FUNDCHNCODE
and a.MERNO = d.merno;这条语句不太懂,请帮忙看看
a.MERNO,
a.TRANSFEEsum,
a.cnt,
SUBSTR(c.ACC_DATE, 0, 6),
'0',
b.RESERVACCTID,
d.merstlbook
from (SELECT MERNO,
CAPCHANNELNO,
NVL(sum(TRANSFEE), '0.00') TRANSFEEsum,
count(*) cnt
from T_CLEAR_TRANSORDER
--where transdate like :acc_date and feesubtype = '02'
group by (merno, CAPCHANNELNO)) a,
"View_T_PAY_FUNDCHN_INFO" b,
t_daily_info c,
T_CLEAR_MERCLEAR_BOOK d
where a.CAPCHANNELNO = b.FUNDCHNCODE
and a.MERNO = d.merno;这条语句不太懂,请帮忙看看
--取序列中的值
seq_clear_id.nextval
--一个子查询
(SELECT MERNO,
CAPCHANNELNO,
NVL(sum(TRANSFEE), '0.00') TRANSFEEsum,
count(*) cnt
from T_CLEAR_TRANSORDER
--where transdate like :acc_date and feesubtype = '02'
group by (merno, CAPCHANNELNO)) a,
--一个联合查询
"View_T_PAY_FUNDCHN_INFO" b,
t_daily_info c,
T_CLEAR_MERCLEAR_BOOK d
--联合查询的关联条件,c表的关联条件为何不加,最好加入
where a.CAPCHANNELNO = b.FUNDCHNCODE
and a.MERNO = d.merno;