I've been trying to figure out how to get the products that match a certain category id but I have been unable to figure out how to move from category to products.
How would a query that basically selects all products that match a certain category id look?
This should work:
Or if you prefer a join:
Simply replace
CATEGORY_ID
by the ID of the category you wish to select.product_category
is a link table, joining the tablesproducts
andproduct_category
together: it contains thecatalogid
, referencing the ID of the category, andcatalogid
, referencing the ID of the product.