Loading ...
Sorry, an error occurred while loading the content.

Inner Joins

Expand Messages
  • Jennie
    What is the correct way to write one? Jennie
    Message 1 of 6 , Jul 22, 2003
    • 0 Attachment
      What is the correct way to write one?

      Jennie
    • Jenny Connors
      Hi Jennie, Here s an example: SELECT field1, field2, field3 FROM first_table INNER JOIN second_table ON first_table.keyfield = second_table.foreign_keyfield
      Message 2 of 6 , Jul 25, 2003
      • 0 Attachment
        Hi Jennie,

        Here's an example:

        SELECT field1, field2, field3
        FROM first_table
        INNER JOIN second_table
        ON first_table.keyfield = second_table.foreign_keyfield

        Jenny

        At 01:07 PM 7/22/2003, you wrote:
        What is the correct way to write one?

        Jennie

        www.theconnorswebsite.com

      • Tushar G Kapila
        Hello , that s the syntax for SQL server for oracle need something like SELECT fld1, a1.keyFld1 FROM tbl1 a1 , tbl2 a2 where a1.keyFld1 = +a2.keyFld1 ; here
        Message 3 of 6 , Jul 28, 2003
        • 0 Attachment
           
           
          Hello ,
           
          that's the syntax for SQL server for oracle need something like
           
           
          SELECT fld1a1.keyFld1 
          FROM tbl1 a1
          tbl2 a2
          where a1.keyFld1  = +a2.keyFld1  ;

          here a1 and a2 are aliases for the tables (short forms) , and the + sign tells oracle on which table the inner join should be applied.
           
          Regards,
          Tushar

          Mphasis - BFL Limited,
          www.mphasis.com
          Architecting Value
          SEI Level 5 ISO9001

          -----Original Message-----
          From: Jenny Connors [mailto:theconnors@...]
          Sent: Friday, July 25, 2003 9:18 PM
          To: SQLQueriesNoCode@yahoogroups.com
          Subject: Re: [SQLQueriesNoCode] Inner Joins

          Hi Jennie,

          Here's an example:

          SELECT field1, field2, field3
          FROM first_table
          INNER JOIN second_table
          ON first_table.keyfield = second_table.foreign_keyfield

          Jenny

          At 01:07 PM 7/22/2003, you wrote:
          What is the correct way to write one?

          Jennie

          www.theconnorswebsite.com

          To unsubscribe from this group, send an email to:
          SQLQueriesNoCode-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

        • Patrick Clear
          I m probably missing some strange Oracle thing but... Why on earth do you have to specify which table an inner join will be applied to? Syntax carried over
          Message 4 of 6 , Jul 31, 2003
          • 0 Attachment
            I'm probably missing some strange Oracle thing but...
             
            Why on earth do you have to specify which table an inner join will be applied to?  Syntax carried over for outers?
             
            Thanks,
            Patrick
            ----- Original Message -----
            Sent: Tuesday, July 29, 2003 1:55 AM
            Subject: RE: [SQLQueriesNoCode] Inner Joins

             
             
            Hello ,
             
            that's the syntax for SQL server for oracle need something like
             
             
            SELECT fld1a1.keyFld1 
            FROM tbl1 a1
            tbl2 a2
            where a1.keyFld1  = +a2.keyFld1  ;

            here a1 and a2 are aliases for the tables (short forms) , and the + sign tells oracle on which table the inner join should be applied.

            Regards,
            Tushar

            Mphasis - BFL Limited,
            www.mphasis.com
            Architecting Value
            SEI Level 5 ISO9001

            -----Original Message-----
            From: Jenny Connors [mailto:theconnors@...]
            Sent: Friday, July 25, 2003 9:18 PM
            To: SQLQueriesNoCode@yahoogroups.com
            Subject: Re: [SQLQueriesNoCode] Inner Joins

            Hi Jennie,

            Here's an example:

            SELECT field1, field2, field3
            FROM first_table
            INNER JOIN second_table
            ON first_table.keyfield = second_table.foreign_keyfield

            Jenny

            At 01:07 PM 7/22/2003, you wrote:
            What is the correct way to write one?

            Jennie

            www.theconnorswebsite.com

            To unsubscribe from this group, send an email to:
            SQLQueriesNoCode-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



            To unsubscribe from this group, send an email to:
            SQLQueriesNoCode-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
          • astrologer
            In a nutshell, so that the data engine will know what your intentions are. Usually the join is on two tables that are already linked by a constraint, but this
            Message 5 of 6 , Aug 1, 2003
            • 0 Attachment
              In a nutshell, so that the data engine will know what
              your intentions are. Usually the join is on two tables
              that are already linked by a constraint, but this does
              not have to be the case. It's quite possible to join
              two tables otherwise not connected in the data
              dictionary. Why might one do this? For example, you
              might have a main table and an ad hoc table that
              contains data you are cleaning and which you intend to
              migrate to the main table. Since this table is in test
              and the main table presumably in production, adding a
              constraint might be a no no where you work. But having
              the ability to clean the data is a plus, so joins are
              possible even without a constraint in place.

              Michael

              --- Patrick Clear <patrick.clear@...>
              wrote:
              > I'm probably missing some strange Oracle thing
              > but...
              >
              > Why on earth do you have to specify which table an
              > inner join will be applied to? Syntax carried over
              > for outers?
              >
              > Thanks,
              > Patrick


              =====
              ----------Astrologer_ Where do the broken-hearted park their cars?
            • Patrick Clear
              I get that point... Do it all the time personally (making joins where there are not explicit constraints in the dictionary). It s probably just how I visualize
              Message 6 of 6 , Aug 11, 2003
              • 0 Attachment
                I get that point... Do it all the time personally (making joins where there are not explicit constraints in the dictionary).
                It's probably just how I visualize the joins in my head I guess.  Mainly since the inner joins tend to be a "this" has to be in tbl1 and tbl2 for the match and there's no left over records, I don't really see a point of making a controlling table.
                My mental picture tends to say if I have a controlling table (meaning I want all rows from it, not just the matching) it no longer becomes an inner join but an outer....
                 
                Then again it might be me misdefining terms again...
                 
                Either way thanks for the explanation
                 
                 
                ----- Original Message -----
                Sent: Friday, August 01, 2003 5:51 PM
                Subject: Re: [SQLQueriesNoCode] Inner Joins

                In a nutshell, so that the data engine will know what
                your intentions are. Usually the join is on two tables
                that are already linked by a constraint, but this does
                not have to be the case. It's quite possible to join
                two tables otherwise not connected in the data
                dictionary. Why might one do this? For example, you
                might have a main table and an ad hoc table that
                contains data you are cleaning and which you intend to
                migrate to the main table. Since this table is in test
                and the main table presumably in production, adding a
                constraint might be a no no where you work. But having
                the ability to clean the data is a plus, so joins are
                possible even without a constraint in place.

                Michael

                --- Patrick Clear <patrick.clear@...>
                wrote:
                > I'm probably missing some strange Oracle thing
                > but...
                >
                > Why on earth do you have to specify which table an
                > inner join will be applied to?  Syntax carried over
                > for outers?
                >
                > Thanks,
                > Patrick


                =====
                ----------Astrologer_          Where do the broken-hearted park their cars?



                To unsubscribe from this group, send an email to:
                SQLQueriesNoCode-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
              Your message has been successfully submitted and would be delivered to recipients shortly.