您好,欢迎访问一九零五行业门户网

mysql中将null值转换为0的语句

mysql中将null值转换为0的语句,在mysql数据库开发中,如果后期添加了字段那么这些值为空值null,我们在使用者需要将null转换为0方便后期的控制就需要下面的代码了。
代码如下:
select
if(avg(cai.conversionsrate) is null,0,avg(cai.conversionsrate))
as conversionsrate
from campaign_info cai
where inserttime between '2011-02-01' and '2011-02-04' and googlecampaignid=23331401
其它类似信息

推荐信息