用t-sql查找子组的完整路径 [英] finding full path of subgroup with t-sql
本文介绍了用t-sql查找子组的完整路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想展示一个具有完整路径的小组,从主要父母到自我
像这样:红樱桃:红樱桃>>"樱桃>>水果
我写了一个程序,给我它的父母的名字,但是我想要一个程序,在它后面加上父母的名字,然后给我一个字符串
我想对该表中的所有记录执行此操作
thanx for u answers
解决方案
您要串联的行值: ^ ]
hi
I have a table with this records(GroupId,ParentGroupId,GroupName).
i want to show a group with its full path, from main parent to it self
like this: red cherry: red cherry>>cherry>>fruit
i write a Procedure that give me its parents names,but i want to have a prosedure that append the parents name and give me one string
i want to do this for all records in that table
thanx for u answers
解决方案
you want to concatenate row values: http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/[^]
这篇关于用t-sql查找子组的完整路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文