如何删除表中的重复数据

DELETE
  FROM table1
 WHERE id IN (SELECT id
                    FROM table1
                   GROUP BY id
                  HAVING COUNT(id) > 1)
   AND ROWID NOT IN (SELECT MIN(ROWID)
                       FROM table1
                      GROUP BY id
                     HAVING COUNT(id) > 1)
posted @ 2012-06-25 09:46  wingsless  阅读(327)  评论(2编辑  收藏  举报