在完成一个Access表中数据统计时,需要统计指定字段的和,使用到了Sum函数,但统计时发现,指定条件查询统计时有可能返回空值(Null),导致对应字段显示为空白,正常应显示为0.基本思路是在获取记录集RS后进行判断,然后设置为0. 今天突然想到iif,于是又测试了一篇,比之前的简单多了,关键代码: select iif(isnull(sum(求和字段)),0,sum(求和字段)) as 求和字段别名 from 表名 where 条件…
@ResetController返回数据时出现异常 Could not write JSON: Object is null; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Object is null (through reference chain: com.banxue.common.entity.ReturnEntity["data"]->net.sf.json.JSONO…