树形菜单数据结构

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;

猜你喜欢

转载自www.cnblogs.com/guanghe/p/9576876.html