MySQL/MSSQL has a neat little inline if function you can use within queries to detect null values, as shown below.
SELECT ... foo.a_field AS \"a_field\", SELEC
Use the standard COALESCE function:
SELECT COALESCE(foo.bar, 0) as "bar", ...
Or use Oracle's own NVL function that does the same.