create table product_color_group
(
product_id int not null,
color_group_id int not null,
)
SELECT p.id
FROM product AS p
LEFT JOIN product_color_group AS pcg on p.id = pcg.product_id
WHERE
pcg.color_group_id = 8
ORDER BY p.id;