Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is an old Oracle syntax for outer joins (+) always equivalent to new syntax?

I wonder if it's always possible to rewrite LEFT JOIN using old Oracle syntax(+). In particular, I tried to express the following query using (+)

SELECT *
FROM table_1 a
LEFT JOIN table_2 b ON (b.table1_id = a.id AND b.other_field = 'value1')

without success. Is it possible at all?
Thank you.

like image 286
a1ex07 Avatar asked Dec 21 '22 07:12

a1ex07


1 Answers

I'm guessing you're not using the (+) operator in the test of b.other_field.. This should work:

SELECT *
FROM table_1 a, table_2 b 
WHERE b.table1_id(+) = a.id 
AND b.other_field(+) = 'value1'
like image 151
StevieG Avatar answered Jan 13 '23 16:01

StevieG