INSERT INTO product_option(
product_option_id,
product_id,
option_id,
option_value,
required
) VALUES (
null,
1171,
(
SELECT po.option_id, po.option_value, po.required FROM `product` as p
left outer join product_option as po
on p.product_id = po.product_id
WHERE p.product_id = 1170
group by po.option_id
)
);
INSERT INTO product_option
(
product_option_id,
product_id,
option_id,
option_value,
required
)
SELECT null, 1171, po.option_id, po.option_value, po.required FROM `product` as p
left outer join product_option as po
on p.product_id = po.product_id
WHERE p.product_id = 1170
group by po.option_id;