Home » SQL & PL/SQL » SQL & PL/SQL » ANSI vs Oracle Join Syntax
ANSI vs Oracle Join Syntax [message #684475] |
Sat, 12 June 2021 09:43  |
 |
dancko
Messages: 108 Registered: June 2013 Location: italy
|
Senior Member |
|
|
Hi to all
I see recommendation to use ANSI join instead of Oracle conventional one.
But the advantages are only better readability and avoid potential unwanted cartesian product?
In particularly, what I want to know is, will there be any difference in performance?
What is better in performance, ANSI syntax or Oracle one?
Thanks in advance.
[Updated on: Sat, 12 June 2021 09:47] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: ANSI vs Oracle Join Syntax [message #684482 is a reply to message #684479] |
Sun, 13 June 2021 11:40   |
 |
Littlefoot
Messages: 21826 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Based on my own experience:
- some Oracle tools (like Reports Builder, e.g. 10g) don't understand JOINs; they force you to use the old, comma-separated list of tables in the FROM clause (for example, in Format Triggers)
- Oracle's "old" outer join operator, (+), lets you outer join one table to max one another table. OUTER JOIN, on the other hand, lets you outer join it to as many tables as needed, in a simple manner
|
|
|
|
Re: ANSI vs Oracle Join Syntax [message #684483 is a reply to message #684482] |
Sun, 13 June 2021 13:37   |
Solomon Yakobson
Messages: 3305 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
Quote:Oracle's "old" outer join operator, (+), lets you outer join one table to max one another table.
You have to be more specific and not confuse people. What you said was true to old, long desupported versions:
SQL> SELECT BANNER
2 FROM V$VERSION
3 /
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for 64-bit Windows: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
SQL> SELECT *
2 FROM DUAL T1,
3 DUAL T2,
4 DUAL T3,
5 DUAL T4
6 WHERE T1.DUMMY(+) = T2.DUMMY
7 AND T1.DUMMY(+) = T3.DUMMY
8 AND T1.DUMMY(+) = T4.DUMMY
9 /
AND T1.DUMMY(+) = T3.DUMMY
*
ERROR at line 7:
ORA-01417: a table may be outer joined to at most one other table
SQL> SELECT BANNER
2 FROM V$VERSION
3 /
BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE 12.1.0.2.0 Production
TNS for 64-bit Windows: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
SQL> SELECT *
2 FROM DUAL T1,
3 DUAL T2,
4 DUAL T3,
5 DUAL T4
6 WHERE T1.DUMMY(+) = T2.DUMMY
7 AND T1.DUMMY(+) = T3.DUMMY
8 AND T1.DUMMY(+) = T4.DUMMY
9 /
D D D D
- - - -
X X X X
SQL>
SY.
|
|
|
|
|
|
Goto Forum:
Current Time: Sun Nov 09 02:09:57 CST 2025
|