Vuoi un INSERT ... SELECT. Un metodo pulito usa NOT EXISTS:
insert into b (id, key, value_b) select a.id, 'right', a.value_a from a where not exists (select 1 from b where b.id = a.id and b.key = 'right' );Questo copia ogni riga da a a b con un nuovo valore key, solo se non esiste già una riga corrispondente.