title: How do I delete duplicate rows and keep the first row?
body: <p>I made a mistake and I have unwanted duplicates.</p>
  
  <p>I have a table with 4 key fields. <code>A1</code>, <code>k1</code>, <code>k2</code>, <code>k3</code>.</p>
  
  <p><code>A1</code> is auto increment and the primary key.</p>
  
  <p>the combination of <code>k1</code>, <code>k2</code> and <code>k3</code> is supposed to be unique and I have to delete the duplicate rows before I create a unique index. Some rows have one duplicate, some have many.</p>
  
  <pre><code>SELECT CONCAT(k1, k2, k) AS dup_value
    FROM myviews
   GROUP BY dup_value
  HAVING (COUNT(dup_value) &gt; 1)
  </code></pre>
  
  <p>shows me duplicates values that I need to deal with. But now I don't know how to keep one and delete the rest of each duplicate set.</p>