Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Un modo efficace per eliminare le righe duplicate da milioni di record

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