Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6469813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:02:14+00:00 2026-05-25T06:02:14+00:00

According to http://www.orafaq.com/node/855 The record in that table for Incomplete Join Trail Wrong way

  • 0

According to
http://www.orafaq.com/node/855
The record in that table for “Incomplete Join Trail”

Wrong way of coding is:

select *
from T1, T2, T3, T4
where T1.C1 = T2.C1(+)
and T2.C2 = T3.C2(+)
and T3.C3 = T4.C3;

Right way of coding is:

select *
from T1, T2, T3, T4
where T1.C1 = T2.C1(+)
and T2.C2 = T3.C2(+)
and T3.C3 = T4.C3(+); 

This I couldn’t understand. There is a possibility that I might want to do a equi-join T3 & T4 and outer join between the other tables. Why is the author saying it is incorrect?

According to http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5229892958977,

Tom is using the following example in his answer which seems similar to the “Incomplete Join Trail” example listed above,

select * 
  from t1,t2,t3
 where t1.x = t2.x and t2.y = t3.y(+);

Could anyone help me understand this?

Edit:

Please correct me if I am wrong. As per Allan’s answer, the following code would be correct:

select *
from T1, T2, T3, T4
where T3.C3 = T4.C3
and T1.C1 = T2.C1(+)
and T2.C2 = T3.C2(+);

If the above is correct, will it be equivalent to the following quoted answer?.[ie., Can we do this in oracle’s sql without the subquery in the quoted answer?]

SELECT *
FROM   t1, t2, (SELECT *
                FROM   t3, t4
                WHERE  t3.c3 = t4.c3) t3_4
WHERE  t1.c1 = t2.c1(+) AND t2.c2 = t3_4.c2(+);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:02:14+00:00Added an answer on May 25, 2026 at 6:02 am

    Inner joins require a matching row to be present in order to return a row. In your first query, rows must be present in tables T1 and T4 in order for a resulting row to be returned. Since T1 connects to T4 by going through T2 and T3, those outer joins are render irrelevant. You can check this pretty easily, as the optimizer will know that they’re irrelevant and will show them as inner joins in the explain plan.

    You can still have an inner join between T3 and T4, but you need to do it in a sub-query in order to make the outer join with T2 functional:

    SELECT *
    FROM   t1, t2, (SELECT *
                    FROM   t3, t4
                    WHERE  t3.c3 = t4.c3) t3_4
    WHERE  t1.c1 = t2.c1(+) AND t2.c2 = t3_4.c2(+);
    

    Incidentally, SQL-99 syntax is preferred these days, which would allow you to do this without the sub-query:

    SELECT *
    FROM              t1
           LEFT JOIN  t2
                   ON t1.c1 = t2.c1
           LEFT JOIN  (t3
           JOIN       t4
                   ON t3.c3 = t4.c3)
                   ON t2.c2 = t3.c2;
    

    Finally, in the example you use from AskTom, the outer join is on the last join in the chain, not the middle. That case is okay.


    Regarding the revised question, no the new query would not work. The where clause is not ordered, so the optimizer will treat that in exactly the same way as the original query. As far as I know, there’s not any way to resolve this outside of using some form of sub-clause in the from clause.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

according to http://www.w3schools.com/dom/dom_node.asp , to get the text content of a node, textContent for
According to http://www.codeguru.com/forum/showthread.php?t=463663 , C#'s getHashCode function in 3.5 is implemented as: public override
According to this http://www.cplusplus.com/reference/clibrary/csignal/signal.html SIGINT is generally used/cause by the user. How do i
According to this: http://www.codeplex.com/IronPython/Wiki/View.aspx?title=IP20VsCPy25Perf&referringTitle=IronPython%20Performance IronPython (Python for .Net) is faster than regular Python (cPython)
According to google and some other sources (e.g., http://www.enterprisedt.com/publications/oracle/result_set.html ), if I want to
According to http://jqueryui.com/demos/tabs , tabs that load content via AJAX will show Loading... while
According to http://www.rebol.com/docs/core23/rebolcore-15.html You can use change/part to parse and replace but that doesn't
According to http://www.assembla.com/wiki/show/scala-ide/Troubleshooting in order to have the Scala Eclipse plugin to work with
According to this: http://www.8052.com/tutsfr.php , the sfrs whose address are divisible by 8 are
According to http://www.cplusplus.com/reference/clibrary/ctime/time_t/ time_t is the number of seconds since midnight 1/1/1970 UTC. So

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.