Dos pasos:1. actualice los registros con las ubicaciones correctas, 2. elimine los registros con las ubicaciones incorrectas.
update mytable
set onhand = onhand +
(
select coalesce(sum(wrong.onhand), 0)
from mytable wrong
where wrong.location like ' %'
and trim(wrong.location) = mytable.location
)
where location not like ' %';
delete from mytable where location like ' %';