title: Delete duplicate rows with same ID number
body: <p>I noticed that I have a lot of duplicates in one of my tables.
  Here's an example of how the table looks (example with one id_product_attribute number):</p>
  
  <p><a href="https://i.stack.imgur.com/n8bl8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n8bl8.png" alt="enter image description here"></a></p>
  
  <p>So I want to delete the duplicate currencies for EACH id_product_attribute.
  The desired result is to have one id currency for each id_product_attribute. Which means: 1, 2, 3, 4, 6 --> 5 rows per id_product and not 10 (5 duplicates).</p>
  
  <p>I tried to use different codes but I can't make it work:</p>
  
  <pre><code>DELETE FROM product_attribute USING product_attribute, product_attribute pa
  WHERE product_attribute.id_currency &gt; pa.id_currency
  AND product_attribute.id_product_attribute = pa.id_product_attribute
  AND product_attribute_price.id_product_attribute = '16632'
  </code></pre>
  
  <p>So If I run the above, I will delete everything and only id_curreny 1 will stay there. I need to have:</p>
  
  <pre><code>Attribute Currency 
    16632    -    1
    16632    -    2
    16632    -    3
    16632    -    4
    16632    -    6
  </code></pre>
  
  <p>Can anyone help me with this? Any hint would be much appreciated. </p>
  
  <p>Thank you</p>