I have 2 tables for items and categories. the categories table is self joint table.
Item Table has the following columns ID, Item_Name, CategoryID
Categories Table has the following columns CATID, category_name, parent_ID
I need to to select items which are listed under a category and the subcategories of this main category but does not work. here's mysql, it returns only the sub.
Select * from
Items A
where
A.CategoryID in(select CATID from categories
where CATID= %value% or parent_ID=%value%)