0

在我的表中有很多重复的行。我有一个 SELECT 提供我要删除的数据,但我该怎么做?无论我尝试什么,都会出错。

SELECT *
  FROM tablename t
 WHERE NOT EXISTS (         
              SELECT 1
                FROM tablename t2
               WHERE t2.column = t.column
              HAVING COUNT(*) = 1
                     )
4

1 回答 1

0

只需将 'SELECT *' 更改为 'DELETE'

DELETE 
FROM tablename t
WHERE NOT EXISTS (         
              SELECT 1
              FROM tablename t2
              WHERE t2.column = t.column
              HAVING COUNT(*) = 1
              )
于 2013-10-06T11:18:11.543 回答