I fall MySQL 8.0 eller senare kan du använda nästa fråga:
INSERT IGNORE INTO products
SELECT
id_product,
143 as id_category,
(
SELECT MAX(position)
FROM products
WHERE id_category = 143
) +
(row_number() over (order by id_product)) as position
FROM products
WHERE id_category = 12;