-5

我有一个表格,里面填满了重复的行。我需要通过删除所有重复的行来刷新表格。我可以通过编写程序来做到这一点。有什么最快的方法吗?

4

1 回答 1

0
DELETE MyTable 
FROM MyTable
LEFT OUTER JOIN (
   SELECT MIN(RowId) as RowId, Col1, Col2, Col3 
   FROM MyTable 
   GROUP BY Col1, Col2, Col3
) as KeepRows ON
   MyTable.RowId = KeepRows.RowId
WHERE
   KeepRows.RowId IS NULL
于 2012-09-04T07:47:42.827 回答