title: How to delete duplicate rows in SQL Server?
body: <p>How can I <strong>delete duplicate rows</strong> where no <code>unique row id</code> exists?</p>
  
  <p>My table is</p>
  
  <pre><code>col1  col2 col3 col4 col5 col6 col7
  john  1    1    1    1    1    1 
  john  1    1    1    1    1    1
  sally 2    2    2    2    2    2
  sally 2    2    2    2    2    2
  </code></pre>
  
  <p>I want to be left with the following after the duplicate removal:</p>
  
  <pre><code>john  1    1    1    1    1    1
  sally 2    2    2    2    2    2
  </code></pre>
  
  <p>I've tried a few queries but I think they depend on having a row id as I don't get the desired result. For example:</p>
  
  <pre><code>DELETE
  FROM table
  WHERE col1 IN (
      SELECT id
      FROM table
      GROUP BY id
      HAVING (COUNT(col1) &gt; 1)
  )
  </code></pre>