OUTER JOIN on more than 2 tables!
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: OUTER JOIN on more than 2 tables!

Hybrid View

  1. #1
    Join Date
    Aug 2001
    Posts
    12

    Question

    Hi!
    Friends, please help with this urgent problem: How can an outer join be written on more than one table?

    An SQL Server query:

    SELECT * from a INNER JOIN b on a.id = b.id LEFT OUTER JOIN c ON c.id = a.id AND c.id = b.id

    works fine with SQL SERVER
    But Oracle query:

    SELECT * from a,b,c WHERE a.id = b.id AND a.id = c.id (+) AND b.id = c.id (+)

    gives an error: OUTER JOIN cannot be used on more than one table? Why?

    Please, help!

  2. #2
    Join Date
    Aug 2001
    Posts
    12
    Here's the exception number and short description

    - java.sql.SQLException: ORA-01417: a table may be outer joined to at most one other table

  3. #3
    Join Date
    Nov 2000
    Location
    Israel
    Posts
    268
    Hi,
    Oracle says you have to join b and c in a view first.
    Try this:

    SELECT * from a,b,c
    WHERE a.id = b.id AND
    a.id = c.id (+)
    and b.id in (select b.id from b,c where b.id = c.id (+));

    regards,
    R.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width