How to Delete Duplicates from a table with no Identity Column


with duplicate as (
SELECT     row1,row2,row3,
row_Number () Over (partition by row1,row2,row3 order by row1)
as RowNumber
FROM  YourTable
)
delete from duplicate
where RowNumber >=2

Comments

Popular posts from this blog

SSIS vs. T-SQL

Sync SSAS Cube From One Environment to Another

SQL Function to replace special characters from a string