先生,我的查询显示RUNNING TOTAL,但没有显示我根据事务检查Dr_amount和Cr_amount如何按单个事务获取Dr_amount和Cr_amount
SELECT
V_DATE,FLAG,V_NUM,V_NARATION,
sum(DR_AMOUNT) AS DEBIT,
sum(CR_AMOUNT) AS CRIDIT,
sum(dr_amount)-sum(cr_amount) as total
FROM VOUCHARDETAIL AS VDTL
INNER JOIN VOUCHARMASTER AS VMST
ON VDTL.DTL_NUM <=VMST.MST_NUM
WHERE (V_DATE BETWEEN '12-03-2017' AND '13-03-2017') AND (FLAG='IV' OR FLAG='BR'
OR FLAG='CP' OR FLAG='CR' OR FLAG='JV') AND (AC_CODE=60030002)
GROUP BY
V_DATE,FLAG,V_NUM,V_NARATION
ORDER BY
V_DATE