原文:sql中查询类型为int的字段,返回null的异常

项目中用mybatis .x,用sql查询某个表类型为int的字段,那个表是空表,没有数据,结果抛异常了,原因是在对象中的属性为int,空表时,sql查询出来的是NULL,结果赋值时抛异常了。 org.apache.ibatis.binding.BindingException: Mapper method getSort xx.yy.cc.DxxDAO attempted to return n ...

2012-07-04 17:05 1 10580 推荐指数:

查看详情

mysql查询字段null 返回0

SELECT IF(字段 IS NULL,0, 字段) as 重命名 From xxx SELECT IF(LENGTH(visit_no)>0,1,0) as 重命名 From xxx ...

Wed Jan 20 00:50:00 CST 2021 0 1551
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM