Skip to content
Advertisement

SELECT subCategory which equals parentCategory = value from outer table

I have a products table and I need to put discount on some products from a given sub category, which has parent category in another table.

It’s a pretty simple question but I can’t figure out how to use the parent_id column to update my products table simply, instead of writing down every subcategory id like this:

I want to update the products table by selecting the subcategory’s parent id from the product_category table.

Advertisement

Answer

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement