title: Select Distinct using a join
body: <blockquote>
  <pre><code>select DISTINCT cid,cname,tid
      from colors c
      left join tags t on t.tname = c.cname;
  </code></pre>
  </blockquote>
  
  <p><strong>colors:</strong></p>
  
  <blockquote>
    <p>cid cname</p>
    
    <p>1 red</p>
    
    <p>2 blue</p>
    
    <p>3 green</p>
  </blockquote>
  
  <p><strong>tags:</strong></p>
  
  <blockquote>
    <p>tid tname</p>
    
    <p>1 red</p>
    
    <p>2 red</p>
    
    <p>3 blue</p>
    
    <p>4 green</p>
  </blockquote>
  
  <p><strong>Current Result:</strong></p>
  
  <blockquote>
    <p>1 red 1</p>
    
    <p>1 red 2</p>
    
    <p>2 blue 3</p>
    
    <p>3 green 4</p>
  </blockquote>
  
  <p><strong>Expected Result:</strong></p>
  
  <blockquote>
    <p>1 red 1</p>
    
    <p>2 blue 3</p>
    
    <p>3 green 4</p>
  </blockquote>