SQL 中sum 是NULL的不显示出来, 怎样显示出0 还有显示出来的是乱的 怎么按我想要的排出来 5
SELECTsum(d.DebitAmount+d.CreditAmount)AScFROMPUB.GLJrnDtldWHEREd.SegValue1IN('660229...
SELECT sum(d.DebitAmount+d.CreditAmount) AS c
FROM PUB.GLJrnDtl d
WHERE d.SegValue1 IN ('6602290000','6602250000','6602060000','6602070000','6602350000',
'6602360000','6602010000','6602020000','6602030000','6602040000','6602050000','6602080000',
'6602090000','6602100000','6602130000','6602160000','6602170000','6602230000','6602300000','6602320000')
AND d.JEDate BETWEEN to_date('2012-01-01') AND to_date('2012-01-31')
AND d.SegValue3='0101' AND d.Description<>'费用类自动结转'
group by d.SegValue1
打印出来的只有11个 null的都不显示
而且都不是按条件的顺序排列 展开
FROM PUB.GLJrnDtl d
WHERE d.SegValue1 IN ('6602290000','6602250000','6602060000','6602070000','6602350000',
'6602360000','6602010000','6602020000','6602030000','6602040000','6602050000','6602080000',
'6602090000','6602100000','6602130000','6602160000','6602170000','6602230000','6602300000','6602320000')
AND d.JEDate BETWEEN to_date('2012-01-01') AND to_date('2012-01-31')
AND d.SegValue3='0101' AND d.Description<>'费用类自动结转'
group by d.SegValue1
打印出来的只有11个 null的都不显示
而且都不是按条件的顺序排列 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询