前端之家收集整理的这篇文章主要介绍了
如何在SQL中删除重复记录,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在
sql Server 2005及更高版本中:
WITH q AS
(
SELECT *,ROW_NUMBER() OVER (PARTITION BY dup_column ORDER BY dup_column) AS rn
FROM mytable
)
DELETE
FROM q
WHERE rn > 1
原文链接:https://www.f2er.com/mssql/84254.html