Results 1 to 7 of 7

Thread: Inner Join

  1. #1
    Join Date
    Jul 2006
    Posts
    111

    Unanswered: Inner Join

    What is the point of the 4th line below? It is one of the conditions of the INNER JOIN for the table aliased PD, however it does not involve PD at all?
    (Assume a select block comes before the code below)
    TIA.

    Code:
    	INNER JOIN Pay_Details PD 
    		ON PF.Key = PD.Key 
    		ON CD.ClaimID = PD.Id 
    		ON O.Key = PF.Key

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912

    Post

    Hi

    It looks like SQL generated by Enterprise Manager (although formatted by a homo sapian). I strongly suspect that the preceding FROM clause would be a bit like:
    Code:
    FROM    SomeTable CD
        INNER JOIN AnotherTable O
        INNER JOIN YetAnotherTable PF
        INNER JOIN Pay_Details PD
             ON PF.Key = PD.Key
             ON CD.ClaimID = PD.Id
             ON O.Key = PF.Key
    The gist is - the ON Table1.Col = Table2.Col lines do not have to follow a strict order.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by pootle flump
    the ON Table1.Col = Table2.Col lines do not have to follow a strict order.
    i'll bet that they do in the sql standard

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by r937
    i'll bet that they do in the sql standard

    I don't think I'll take you up on that bet Rudy
    EM is almost gleefull in producing the most gloriously obsuciatory FROM clauses it possibly can - whether or not it adheres to the standard.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by pootle flump
    I don't think I'll take you up on that bet Rudy
    EM is almost gleefull in producing the most gloriously obsuciatory FROM clauses it possibly can - whether or not it adheres to the standard.
    Are you suggesting that EM is not strictly, 100% standards compliant?

    Heretic!!!!!!!!

    You MUST be a plant from Oracle. Or Sun.

    Regards,

    hmscott
    Have you hugged your backup today?

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by hmscott
    You MUST be a plant from Oracle. Or Sun.
    actually, i'm a user of microsoft products, which is why i have such a well-defined opinion of them

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Jul 2006
    Posts
    111
    thanks that 2nd reply must be it...

Posting Permissions

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