Mariadb rzucaj null na 0
SELECT COALESCE(col, 0) FROM `table`;
Matteoweb
SELECT COALESCE(col, 0) FROM `table`;