prader6

mysql 对返回的值是null进行判断和重新赋值

SELECT IFNULL(sum(c.tax_data),0) ,IFNULL(SUM(c.fiscal_ret),0)   FROM corp_tax c WHERE c.industry_id = 100
   
    and c.corp_year =2018 and c.corp_month =6 and c.status = 1 and park_id=1

使用ifnull(expr,expr) 来处理。上面的sql  sum(c.tax_data) 如果是null 则返回0.

posted on 2019-05-24 10:15  prader6  阅读(3627)  评论(0编辑  收藏  举报

导航