sql >> Base de Datos >  >> RDS >> Sqlserver

Manera efectiva de eliminar filas duplicadas de millones de registros

with dupl as (
select row_number() over(partition by col1,col2,col3,col4,col5,col6 order by id) rn,
id,col1,col2,col3,col4,col5,col6
from myTable
)
delete dupl where rn>1