Saturday, March 30, 2013

SQL to Delete Duplicate Rows in a Table


DELETE FROM xx_table 
 WHERE ROWID NOT IN (SELECT MIN(ROWID) 
                       FROM xx_table 
                      GROUP BY col1, col2....);

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.