Mariadb rzucaj null na 0

SELECT COALESCE(col, 0) FROM `table`;
Matteoweb