问题描述
我的桌面结构是: - >
________________________________________
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?
推荐答案
这篇关于如何计算特定用户下的左侧成员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!