Posted By

samwa on 03/23/11


Tagged

sql delete


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

samwa


Delete duplicate rows from a table


 / Published in: SQL
 

URL: http://www.cryer.co.uk/brian/sql/sql_delete_duplicates.htm

this will delete where uniqueField is greater

  1. DELETE T1
  2. FROM MyTable T1, MyTable T2
  3. WHERE T1.dupField = T2.dupField
  4. AND T1.uniqueField > T2.uniqueField

Report this snippet  

You need to login to post a comment.