首頁 >資料庫 >mysql教程 >数据库转化null值_MySQL

数据库转化null值_MySQL

WBOY
WBOY原創
2016-06-01 13:51:16833瀏覽

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