4 Replies Latest reply on Jan 25, 2014 4:55 PM by Kevin Chan

    Help with Linking Tables

    Kevin Chan



      I have two tables that I am trying to link / combine. These two tables have numerous columns of overlapping data. Table 1 is huge and has a unique identifier on each row. Table 2 is fairly small with each row having a unique identifier that corresponds to a row in Table 1. I've read numerous articles about editing connections and joining / blending data but I'm not sure how to proceed. Any help would be much appreciated. Thank you very much in advance.



        • 1. Re: Help with Linking Tables
          Matt Lutton

          It depends on what the result set you want should look like.


          If Table 1 has every possible identifier in it, you can use a left join on that identifier in the "Multiple Tables" option.  Start with the larger table, and left join Table 2 to it.  You'll end up with all the rows from Table 1, with the rows that match the identifier in Table 2 being joined to the data.  An inner join would result in only rows that match in BOTH tables.  And a right join would be the opposite of the left join.


          Data blending is a bit different, and has its own limitations and complications.  If a JOIN will work, I'd go that route.


          Someone can correct me if my descriptions are wrong.  I'm still not an expert on joins, but I believe my descriptions are fairly accurate.

          • 2. Re: Help with Linking Tables
            Kevin Chan

            Thank you for your help Matthew! Would you only join on the unique identifier or on all the common columns?

            • 3. Re: Help with Linking Tables
              Matt Lutton

              I would need to know more about your dataset and what you are trying to accomplish to be able to answer that.


              The description I gave above will be true for any fields you choose.  So, for example, in my datasets, I often have an InstitutionID, and StudentID.  I often perform various joins on these identifiers, because I want my result set to include records that match on both identifiers.  if that makes any sense to you.


              There's a lot of info out there on JOINS, as well as examples to study.

              SQL Joins


              database - SQL JOIN and different types of JOINs - Stack Overflow


              I hope this helps.  If you still need assistance, you could randomize some of your data from both tables, and post them here for helpers to take a look at.  We'd also need a description of what you are trying to accomplish, and what the resulting data should include.



              • 4. Re: Help with Linking Tables
                Kevin Chan

                Those articles were very helpful - thank you Matthew!