title: removing duplicate row from mysql where value equals something
body: <p>I've all the way to the end of the internet and I'm proper stuck. Whilst I can find partial answer I'm unable to modify it to make it work. </p>
  
  <p>I have a table named <strong><code>myfetcher</code></strong> like:</p>
  
  <pre><code>+-------------+--------------+------+-----+---------+----------------+
  | Field       | Type         | Null | Key | Default | Extra          |
  +-------------+--------------+------+-----+---------+----------------+
  | fid_id      | int(11)      | NO   | PRI | NULL    | auto_increment |
  | linksetid   | varchar(200) | NO   |     | NULL    |                |
  | url         | varchar(200) | NO   |     | NULL    |                |
  +-------------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>The <code>url</code> field would sometimes contain dupes but rather than remove all duplicates in the table, I need only where the field <code>linksetid</code> is equal to <code>X</code>.</p>
  
  <p>The SQL below removes all duplicates in the table (which is not what I want)... but what I want is only the duplicates within a set range in the field <code>linksetid</code>. I know I'm doing something wrong, just not sure what is it.</p>
  
  <pre class="lang-sql prettyprint-override"><code>DELETE FROM myfetcher USING myfetcher, myfetcher as vtable 
  WHERE (myfetcher.fid&gt;vtable.fid)
    AND (myfetcher.url=vtable.url)
    AND (myfetcher.linksetid='$linkuniq')
  </code></pre>