MySQL避免SUM求和返回null

MySQL

SELECT
COALESCE(SUM(money_award), 0) AS money_award
FROM
invite_award
WHERE
master_id = '1'


MyBatis

<select id="sumByMasterId" resultType="BigDecimal">
SELECT
COALESCE(SUM(money_award), 0) AS money_award
FROM
invite_award
WHERE
master_id = #{masterId}
</select>