select T.PK_SCJSZB,T.PK_CBDX,T.PK_BANZU,T.PK_ZLLH, SUM(T.DRSJ)from frbb.sc_scjszbsj twhere T.DDATE >= substr('${rq}',1,7)|| '-01'and t.ddate <= '${rq}'and t.pk_deptdoc = '${bm}'GROUP BY PK_SCJSZB,PK_CBDX,PK_BANZU,PK_ZLLH//////select t.PK_INVBASDOC,PK_BANZU,SUM(T.scsl),sum(T.srsl),t.pk_cbdx,NOTE from frbb.kc_crkd t where T.DDATE >= substr('${rq}',1,7)|| '-01' and t.ddate <= '${rq}' and t.pk_deptdoc='${bm}' group by t.PK_INVBASDOC,PK_BANZU,t.pk_cbdx,NOTE