I have two tables:
[ product_to_category
---------------------
product_id
category_id
[ category
---------------------
category_id
parent_id
I need to get all product_id's with a category.parent_id of '39'. Here's what I'm trying, but it's returning empty when there are at least a few hundred:
SELECT
product_id
FROM
product_to_category
WHERE
category_id IN (
SELECT parent_id FROM category WHERE parent_id = '39'
)
Is what I'm trying to do here possible?