title: Connecting two Tables using a third Table (SQL)
body: <p>I am trying to write a query to produce a column with text values from one table that is has code relevent to a second table which has keys relevent to a third table in which I want to put the colmun. The second table has a column with keys to the relevent elements in the first table and keys relevent to the third table. The third table is a log of occurances related to the secondtable. Ill try to illustrate below:</p>
  
  <pre><code>First Table                  Second Table                 Third Table
  Name1 | Code1          Code1  |  Name2  | Code2              Code 2
  -------------         --------------------------          -----------
  Red   |   1              1    |  Ball   |  10                  10
  Blue  |   2              2    |  Toy    |  20                  20
  Green |   3              3    |  Grass  |  30                  30
  </code></pre>
  
  <p>The tricky part is I need both Names as separte columns in the third table. Not sure if it matters but the third table has a bunch of other columns with other codes that I have already joined with other tables.</p>
  
  <p>Should look like this:</p>
  
  <pre><code>    Third Table
   Name1  |  Name2 
  -----------------
    Red   |  Ball   
    Blue  |  Toy    
    Green |  Grass  
  </code></pre>