NVL in select query
694068Feb 1 2011 — edited Feb 2 2011I have query as below
select a.id,
(select dep from table2 where table2.name=table1.name )
from table1
The second value is null as table2.name=table1.name has no value for table1
if i use NVL as below
select a.id,
(select NVL(dep,0) from table2 where table2.name=table1.name )
from table1
it is not fetching 0 in place of dep.Please help.I ned to use NVL here and show value 0 if the select returns null/blank