Home >Database >Mysql Tutorial >mysql中将null值转换为0的语句_MySQL

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

WBOY
WBOYOriginal
2016-06-01 13:20:471148browse

bitsCN.com


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

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn