本文介绍了可能吗??的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个表组
contains
GroupID GroupName ChildId 1 G1 0(0-Means Root Group) 2 G2 0 3 G3 0 4 G4 0 5 G5 1(The GroupId of First Row) 6 G6 5(The GroupId of Fifth Row) 7 G7 2(The GroupId of 2nd Row) 8 G8 7(The GroupId of 7th Row) 9 G9 8(The GroupId of 8th Row) Now I Want The Group Name Of Root Group Through Sql query only I want to get the Name Of the main Group Through its child Id. For Ex. If I select 9(Group Id) It Is Linked With Main Id-2 9->8->7-2-0(Means Group Name-G2)-Where we will get zero it is over Thank You Sukhen Dass
解决方案
I have a table groups
contains
GroupID GroupName ChildId 1 G1 0(0-Means Root Group) 2 G2 0 3 G3 0 4 G4 0 5 G5 1(The GroupId of First Row) 6 G6 5(The GroupId of Fifth Row) 7 G7 2(The GroupId of 2nd Row) 8 G8 7(The GroupId of 7th Row) 9 G9 8(The GroupId of 8th Row) Now I Want The Group Name Of Root Group Through Sql query only I want to get the Name Of the main Group Through its child Id. For Ex. If I select 9(Group Id) It Is Linked With Main Id-2 9->8->7-2-0(Means Group Name-G2)-Where we will get zero it is over Thank You Sukhen Dass
解决方案
这篇关于可能吗??的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!