I have 3 tables right now
1. members
2. members_parents
3. members_status
How can i count the children & grandchildren until to the depth level and separate the count() for the status 0 = free and 1 = subscriber
table: members - list all the records of members
table: members_parents - list of members & the parent member
table: members_status - list the members & parents status where 0 or 1
tbl_members_parents:
id member parent
1 10000 NULL
2 10001 10000
3 10002 10001
and so on ...
How can i count the child & grandchildren until to the 7th level of grand children ?
Thank You

CREATE TABLEstatements and some test data from each one, and, welcome to dba.SE. – oNare Aug 05 '15 at 11:41lftandrgtas two fields to manage whole tree structure fast and traversal and easy way : please check Link OR Link form more information. – bharat Dec 12 '16 at 19:35