SELECT
`plug_cat_sizes_join`.`item_id`,
`plug_cat_sizes_join`.`size_id`,
`plug_cat_colors_join`.`item_id`,
`plug_cat_colors_join`.`color_id`
FROM
`plug_cat_sizes_join`,
`plug_cat_colors_join`
JOIN `plug_cat_vals` as val
ON val.`write_id` = `plug_cat_sizes_join`.`item_id`
AND val.`write_id` = `plug_cat_colors_join`.`item_id`
SELECT
`plug_cat_sizes_join`.`item_id`,
`plug_cat_sizes_join`.`size_id`,
`plug_cat_colors_join`.`item_id`,
`plug_cat_colors_join`.`color_id`
FROM
`plug_cat_sizes_join`
JOIN `plug_cat_colors_join`
ON `plug_cat_colors_join`.`item_id` = `plug_cat_sizes_join`.`item_id`
JOIN `plug_cat_vals` as val
ON val.`write_id` = `plug_cat_colors_join`.`item_id`