#2
厨师王德榜2021-06-25 09:29
|
(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编辑过]