Home Forums Article Discussions Article Discussions by Author Discuss content posted by Tom Huneke SQL Server 2005 Remove Dups - CTE RE: SQL Server 2005 Remove Dups - CTE
DMarvez
Ten Centuries
Points: 1241
More actions
May 9, 2008 at 8:14 am
#813083
Try running these two statements at the same time:
With Dups as
(
select *, row_number() over (partition by Product_Code order by Product_Code) as RowNum from #prod
)
Delete from Dups where rownum > 1;