首页 >数据库 >mysql教程 >数据库转化null值_MySQL

数据库转化null值_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-01 13:51:16842浏览

mysql数据库:

        SELECT<br>        IF(AVG(cai.conversionsRate) IS NULL,0,AVG(cai.conversionsRate))<br>        AS conversionsRate<br>        FROM campaign_info cai<br>        WHERE insertTime BETWEEN '2011-02-01' AND '2011-02-04' AND googleCampaignId=23331401

Ms-SqlServer数据库

        /*MS-SqlServer去除NULL值*/<br>        select ISNULL(avg(cai.conversionsRate),0)<br>        AS conversionsRate<br>        FROM campaign_info cai<br>        WHERE insertTime BETWEEN '2010-02-11' AND '2011-01-23' AND googleCampaignId=42722951
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn