Outer join with NVL function
699077Jul 23 2009 — edited Jul 23 2009Hello
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