本文介绍了我如何排除0结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有这个查询 选择 a.Des作为'Alm', SUM(案例k .IdE当1然后1其他0结束)正常, SUM(情况k.IdE当2然后1其他0结束)as Urgent FROM TblKBA a left join TblKBK k $ b a.Des上的$ b = k.IdAr 组a.Des 此结果 Alm正常紧急 U1.K1.WH1 6 5 U1.K1.WH2 9 9 U1.K2。 WH3 0 0 U2.K3.WH4 0 0 i想要在正常或紧急时隐藏alm行为0,在这个例子中我想隐藏最后两行。 i想得到这个结果 Alm正常紧急 U1.K1.WH1 6 5 U1.K1.WH2 9 9 我怎么能这样做? 问候 我尝试过: i试图结合选择,拥有,在哪里,排除...... 解决方案 I have this queryselect a.Des as 'Alm', SUM (case k.IdE when 1 then 1 else 0 end) as Normal, SUM (case k.IdE when 2 then 1 else 0 end) as Urgent FROM TblKBA a left join TblKBK k on a.idA = k.IdArgroup by a.Des with this resultAlmNormalUrgentU1.K1.WH165U1.K1.WH299U1.K2.WH300U2.K3.WH400i want to hide the alm row when normal or urgent are 0, in this example i want to hide the last two rows.i want to get this resultAlmNormalUrgentU1.K1.WH165U1.K1.WH299How i could do that?regardsWhat I have tried:i tryed to combine selects, having, where, exclude... 解决方案 这篇关于我如何排除0结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-19 22:57