title: SQL Query Distinct Inner Join Issue
body: <p>I'm having a problem with the following SQL INNER JOIN statement. I'm probably missing something syntactically:</p>
  
  <pre><code>SELECT * from
  (SELECT DISTINCT Name from Table.Names WHERE Haircolor='Red') uniquename
  INNER JOIN
  (SELECT * FROM Table.Names) allnames
  ON uniquenames.Name = allnames.Name;
  </code></pre>
  
  <p>I want all the names which have a Haircolor of "Red" but I don't want any duplicate names.</p>
  
  <pre><code>NAME        HAIRCOLOR       ADDRESS   PHONE       EMAIL
  -----       ---------       -------  -----       -----
  Joe         Red          123 Street  20768422    blah@example.com
  Joe         Red         828 Street   703435422   blah4@example.com
  Joe         Red         165 Street   10768422    blah3@example.com
  Jamie       Blond       4655 Street  10568888    blah3@example.com
  John        Brown       941 Street   40768422    blah5@example.com
  Josephine   Red         634 Street   43444343    blah2@example.com
  Josephine   Red         394 Street   43414343    blah7@example.com
  </code></pre>
  
  <p>The query should return:</p>
  
  <pre><code>NAME        HAIRCOLOR       ADDRESS   PHONE       EMAIL
  -----       ---------       -------  -----       -----
  Joe         Red          123 Street  20768422    blah@example.com
  Josephine   Red         634 Street   43444343    blah2@example.com
  </code></pre>
  
  <p>Maybe it involves a GROUP BY?</p>