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
Yup, NVL should do the trick.