查询报表增加小计功能
SELECT ISNULL(T1.KHMC, '总计')客户名称, ISNULL(T1.DJMC, '小计')单据名称, CAST(SUM(T1.SL) AS INT)数量 FROM ( SELECT vl.DM1, k.KHMC, vl.DJMC, vl.SL FROM VW_LSXHDMX AS vl INNER JOIN KEHU AS k ON k.CKDM = vl.DM1 ) T1 GROUP BY T1.KHMC , T1.DJMC WITH ROLLUP
本文来自博客园,作者:liessay,转载请注明原文链接:https://www.cnblogs.com/liessay/p/8072610.html