本文介绍了如何计算特定用户下的左侧成员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的桌面结构是: - >



________________________________________

tableName:UserDetail



userid [int identity]



userName [nvarchar(100)]



leftMemberID [int]



rightMemberID [int]



leftCount [int]





__________________________________________________________________

所有成员都以二叉树格式添加。



我要做的是,如何计算特定用户下的左侧成员???



现在问题是......我想要一个SQL查询,它可以在下面和下面...就像'John Doe'在他下面有两个成员,名为'Suzan'和'Ellie','Suzan'也有2个成员在她之下。和艾莉一样。例如..'John Doe'在他的下线有大约300名成员?

My table structure is:->

________________________________________
tableName:UserDetail

userid [int identity]

userName [nvarchar(100)]

leftMemberID [int]

rightMemberID [int]

leftCount [int]


__________________________________________________________________
All members added in a binary tree format.

What i have to do is that, how to count left side members under particular user???

Now what's the matter is .. I want a SQL Query which can go under and under.. like 'John Doe' having two members under him named 'Suzan' and 'Ellie' and 'Suzan' is also having 2 members under her.. and same for Ellie. and for example.. 'John Doe' having about 300 members in his down line?

推荐答案



这篇关于如何计算特定用户下的左侧成员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 10:10
查看更多