SELECT
IFNULL(sum(security_code_total), 0) createSCNum,
IFNULL(sum(print_num), 0) privateScNum
FROM
security_code_config
WHERE
tid = 'test_tenement_123'
AND
DATE_FORMAT(create_date, '%Y-%m') = DATE_FORMAT('2019-03-01 11:32:54','%Y-%m')
使用IFNULL(查询值,0)