WITH CTE_FriendRecruiters (RNo,FK_User,FK_Promotion,AuthId,AuthMode)
As
(
SELECT ROW_NUMBER() over (partition by AuthId order by AuthId) As RNo ,
FK_User,FK_Promotion,AuthId,AuthMode FROM dbo.FriendRecruiters
)
DELETE FROM CTE_FriendRecruiters where RNo <> 1
As
(
SELECT ROW_NUMBER() over (partition by AuthId order by AuthId) As RNo ,
FK_User,FK_Promotion,AuthId,AuthMode FROM dbo.FriendRecruiters
)
DELETE FROM CTE_FriendRecruiters where RNo <> 1
No comments:
Post a Comment