• I came up this:

    create table testing (retained int, dropped int)

    insert into testing (retained, dropped)

    select 767884, 157441 union all

    select 1046261, 157441 union all

    select 1055257, 157441 union all

    select 157441, 73635 union all

    select 767884, 73635 union all

    select 1046261, 73635 union all

    select 1055257, 73635 union all

    select 1046261, 767884 union all

    select 1055257, 767884 union all

    select 1055257, 1046261

    select * from testing

    ORDER BY dropped,retained;

    WITH UpdateValues AS (

    SELECT

    MAX(retained) AS NewValue,

    dropped

    FROM

    testing

    GROUP BY

    dropped

    )

    UPDATE t SET

    retained = uv.NewValue

    FROM

    testing t

    INNER JOIN UpdateValues uv

    ON (t.dropped = uv.dropped);

    select * from testing

    ORDER BY dropped,retained;

    DROP TABLE testing;