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.
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.
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。