我写了一个查询来从表中删除重复记录
;WITH a as
(
SELECT Firstname,ROW_NUMBER() OVER(PARTITION by Firstname, empID ORDER BY Firstname)
AS duplicateRecCount
FROM dbo.tblEmployee
)
--Now Delete Duplicate Records
DELETE FROM tblEmployee
WHERE duplicateRecCount > 1
但我不知道我哪里出错了
列名无效
duplicateRecCount
有人能帮我吗?