title: Do Not Repeat (DISTINCT) One Column On A Table With MySQL
body: <p>When I use this:</p>
  
  <pre><code>SELECT DISTINCT id FROM table
  </code></pre>
  
  <p>this works! but... when I want to filter only one column I try to do this:</p>
  
  <pre><code>SELECT DISTINCT prod_id, id, prod_picture FROM products
  </code></pre>
  
  <p>this gives me all table... I just need 1 picture for each product, like:</p>
  
  <p>1 | 1 | asd.jpg<br>
  2 | 3 | weq.jph</p>
  
  <p>not</p>
  
  <p>1 | 1 | asd.jpg<br>
  1 | 2 | qwe.jpg<br>
  2 | 3 | weq.jpg</p>
  
  <p>actually I try to use this:</p>
  
  <pre><code>SELECT DISTINCT 
    prod_list.id,
    prod_list.prodname,
    prod_pict.pict_file
  FROM
    prod_list
    INNER JOIN urun_pict ON (prod_list.id = prod_pict_prod_id)
  </code></pre>
  
  <p>I have to filter just "prod_list.id"...</p>