UNION 写明细账问题 怎么让0不显示
SELECT IJ_NO AS 单号, IJ_DD AS 日期, (case when QTY>0 then QTY else '' end) AS 本期收入,
(case when QTY<0 then QTY else 0 end) AS 本期发出
FROM TF_IJ
WHERE (QTY > 0)
UNION ALL
SELECT IJ_NO AS 单号, IJ_DD AS 日期,
(case when QTY>0 then -QTY else 0 end) AS 本期收入,
(case when QTY<0 then -QTY else 0 end) AS 本期发出
FROM TF_IJ
WHERE (QTY <= 0)
[此贴子已经被作者于2021-6-24 09:53编辑过]