Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

NVL in select query

694068Feb 1 2011 — edited Feb 2 2011
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2011
Added on Feb 1 2011
4 comments
6,143 views