针对不同的数据库实现方式有:
sqlserver:
Sql代码
select isnull(字段,0) from 表名 --这样就是把空值赋值为0
MySQL:
Sql代码
select ifnull(字段,0) from 表名
oracle:
Sql代码
select nvl(字段,0) from 表名
---------------------
作者:kerryqpw
来源:CSDN
原文:https://blog.csdn.net/kerryqpw/article/details/81453493?utm_source=copy
版权声明:本文为博主原创文章,转载请附上博文链接!