SELECT id FROM products WHERE category_id = 3 OR product_id IN ( SELECT product_id FROM products_extra_categories WHERE category_id = 3 ) ORDER BY id