SqlServer数据去重处理

删除重复数据,只保留一条

1.使用开窗函数进行数据去重

Delete T From
 (Select Row_Number() Over(Partition By Fdate,col1,col2
 order By Fdate) As RowNumber,* From [dbo].[table_nam]  )T
 Where T.RowNumber > 1