Say I have four tables:
------------- features --------------
id: int
name: varchar
-------------------------------------
-------- feature_categories ---------
feature_id: int
category_id: int
-------------------------------------
----------- categories --------------
id: int
name: varchar
-------------------------------------
------ category_subcategories -------
category_id: int
sub_category_id: int
-------------------------------------
category has many (sub)categories, through self referential join subcategories
A feature has many categories, of those some will be subcategories, through join feature_categories
What I need is to send an array of feature ids and a (main) category id and have returned all subcategories. This is proving more difficult than I would have hoped so I'd appreciate greatly any help. Let me know if this question isn't clear.
EDIT I don't need the feature table to be included in any query. In facet, I only require the subcategory (category) name field to be returned.