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刪除。