1 select child.id, child.name, count(child.name) depth
2 from category parent, category child
3 where child.left >= parent.left
4 and child.right <= parent.right
5 group by child.name
6 order by child.left;
1 select child.id, child.name, count(child.name) depth
2 from category parent, category child
3 where child.left >= parent.left
4 and child.right <= parent.right
5 group by child.name
6 order by child.left;