Is there a way to insert a zero instead of NULL while performing LEFT OUTER JOIN on two tables?
Suppose I have a query like this:
SELECT * FROM
(SEL
something like:-
SELECT * FROM
(SELECT ifnull(uID,0) as uID from Class) T1
LEFT OUTER JOIN
(SELECT ifnull(pID,0) as pID from University) T2
ON T1.uID = T2.pID
CASE WHEN a.fieldname IS NULL
THEN 0
ELSE a.fieldname
END AS fieldname
use ISNULL(field, 0)
this will insert zero if the field is NULL