score:0

You can do this using the ANSI SQL window function min():

select min(id) over (partition by dob) as id, dob
from t;

EDIT:

I'm not quite sure why you would want to set rows to be exact duplicates, but you can do that in a similar way:

with toupdate as (
      select t.*, min(id) over (partition by dob) as new_id
      from t
     )
update toupdate
    set id = new_id
    where id <> new_id;

More questions

More questions with similar tag