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
You want to use NVL, or NVL2
NVL(t.column, 0) NVL2( string1, value_if_NOT_null, value_if_null )