title: Delete from where count greater than 1, but keep a row
body: <p>I have a table like this (SQL2008):</p>
  
  <pre><code>id   url                  updated
  1    http://url1.com      null
  2    http://url2.com      &lt;datetime&gt;
  3    http://url1.com      &lt;datetime&gt;
  </code></pre>
  
  <p>I want to delete ONE of the url1.com records (preferably where updated is not null, but its fine if it doesnt work that way)</p>
  
  <p>I have this query, which deletes all the duplicates - but doesn't keep a record (which is where i'm confused):</p>
  
  <pre><code>DELETE FROM [table] WHERE url IN (
      SELECT url
      FROM [table]
      GROUP BY url
      HAVING COUNT(*) &gt; 1 )
  </code></pre>
  
  <p>How do I limit the delete? Result would ideally be:</p>
  
  <pre><code>id   url                  updated
  1    http://url1.com      null
  2    http://url2.com      &lt;datetime&gt;
  </code></pre>
  
  <p>Right now it ends up like:</p>
  
  <pre><code>id   url                  updated
  2    http://url2.com      &lt;datetime&gt;
  </code></pre>