I have table [categories] - this table contains all the categories in my product catalogue.
there table has a number of fields - the 2 of importance here are the categories id (Unique)
and the parent_id
The top level categories have a blank parent - this is because they are not contained inside another category , there is only 12 of these , the remaining 5,000 categories have a parent id,
The parent id on a record say "This category(category_id) is contained inside this category(parent_id) "
What i am looking for is a well optimised query that will return all the category_id's that are inside a given category id
i.e. child categories, child child categories , child child child categories - an so on.