I have a table like this that parent_id=0 means the current row is the main parent:
---------------------
class_id | parent_id
---------------------
10 0
11 10
12 11
13 12
I want to get rows whose primary parent class_id equals 10
But when I use the SELECT
statement it just returns one row because it has a Hierarchy structure.
SELECT class_id FROM TABLE WHERE parent_id = 10