📜  删除重复行 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:05.541000             🧑  作者: Mango

代码示例1
WITH CTE AS(
   SELECT [col1], [col2], [col3], [col4], [col5], [col6], [col7],
       RN = ROW_NUMBER()OVER(PARTITION BY col1 ORDER BY col1)
   FROM dbo.Table1
)
DELETE FROM CTE WHERE RN > 1