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.

How to JOIN on non-existent value?

2988451Jul 9 2015 — edited Jul 9 2015


Hi all, sorry if the title is confusing, I'm sure the question will be easy for someone out there ...

Below are two tables.  I am left joining them on the Account field where table1.account = table2.account.  Unfortunately, if the Account does not exist in the first table yet (Account hasn't been used yet this month) then I cannot get the Budget value for that Account from the second table.  As you can see, in the second table, Account 3195 does not exist.  NVL doesn't work.  Even if I have to manually list the Account numbers (there are only 25 or so), I can do that if necessary for your solution.

Thank you for your expedient assistance!

AccountBalance
310010
320015
330020

AccountBudget
3100100
3195150
3200200
3300250
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 6 2015
Added on Jul 9 2015
3 comments
4,121 views