title: SQL query to find distinct values in two tables?
body: <pre><code>Table 1              Table 2
  Number | Code        Code | Description
  1234     A           A      Something
  1235     B           C      Something else
  1246     C           D      Something other
  1247     A
  1248     B
  1249     A
  </code></pre>
  
  <p>I would like to find the distinct <code>Code</code> values and get a return like this:</p>
  
  <pre><code>1  |  2
  -------
  A     A
  B
  C     C
        D
  </code></pre>
  
  <p>I can't figure out how to write a SQL query that would return me the above results. Anyone have any experience with a query like this or similar?</p>