Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

default value in outer join

Status
Not open for further replies.

msc0tt

IS-IT--Management
Jun 25, 2002
281
CA
Here's the SQL (Oracle):
select a.name, b.amount
from users a, quota b
where a.name = b.name(+)
order by a.name;

The problem is the rows returned that don't have a corresponding record in the quota table. The amount field is displayed as blank/null, but I need it to display as a 0.
Is this trivial for a rookie like me?
-thanks
 
This is the ANSI SQL forum. Since your SQL statement is Oracle specific, I suggest you'd try an Oracle forum.
 
The nvl function should do what you want though.
 
Thanks Katy, I'll check it out.

p.s. Jarl: There isn't an Oracle specific SQL forum on Tek-Tips. The Oracle Developer forum is MUCH more broad than just SQL, so it was a better bet to pick a generic SQL forum. Also, my basic SQL statement is not 'Oracle specific' just because it runs on Oracle. I correctly assumed that someone with general SQL experience (not me) would have the answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top