Home > Database > Mysql Tutorial > body text

数据库转化null值_MySQL

WBOY
Release: 2016-06-01 13:51:16
Original
798 people have browsed it

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
Copy after login

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
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template