gonito/add-variants.sql

10 lines
317 B
MySQL
Raw Normal View History

insert into variant(submission, name) select id, 'out' from submission;
update out
set variant=subquery.variant_id
from (select O.id as out_id, V.id as variant_id
from out as O, variant as V, submission as S
where V.submission = S.id and O.submission = S.id) AS subquery
where out.id = subquery.out_id;