Friday, April 4, 2014

how to delete duplicate rows?

with cte as (
    select row_number() over (partition by id, name    order by id) as rn    from  xx)
delete from cte
    where rn > 1;

No comments:

Post a Comment