BEGIN;
create temporary table TMP
as select name, summ
from THETABLE
where original = 1
group by name, summ;
update THETABLE set original_already = 0;
update THETABLE inner join TMP on TMP.name = THETABLE.name and TMP.summ = THETABLE.summ
set THETABLE.original_already = 1
drop table TMP;
COMMIT;