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!

Outer join with NVL function

699077Jul 23 2009 — edited Jul 23 2009
Hello

I am trying to translate the following Sybase Query to Oracle . I am running the query on a 10gR1 database.
The problem is with the NVL clause on the join I am getting a runtime exception .
Is there a way to re-write this query without breaking the functionality.



SELECT t1.*,
NVL(t2.Branch_name, t3.Branch_name)
FROM table1 t1
LEFT OUTER JOIN
table2 t2
ON (t1.Account_id = t2.Account_id)
LEFT OUTER JOIN
table3 t3
ON (t1.Account_id = t3.Account_id)
LEFT OUTER JOIN
table4 t4
ON (NVL(t2.Branch_Name, t3.Branch_Name) = t4.cost_centre);

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2009
Added on Jul 23 2009
10 comments
2,512 views