groups and sub group levels. from the 1 table same column

groups and sub group levels. from the 1 table same column.

levelid           groupname   parentlevelid
1      Operation      NULL      
2      NOC      1      
3      SOD      1      
4      Network      2      
5      Network Eng      2
6      Development      3      
7      Application      3      2008-02-10 23:04:28.390      SOD
devdeptAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BrandonGalderisiCommented:
I'm not sure what the question is!
0
devdeptAuthor Commented:
Dear BrandonGalderisi:

I am using c1webgrid to display data for grouping

I have one admin and n level of subgroups in same table. How I use the following sample to my cenario.

Example :
                Operations(main group)
                                Abc
                                                Xyz
                                                Pqr
                                Efg
                                                123
                                                321

i want this query in sql server 2005

i want to make a dynamic query to add groups or select groups and sub groups.

Regards
shams.
0
BrandonGalderisiCommented:
Is this what you want?
select ParT.groupName, subT.GroupName
from YourTable ParT
join yourTable SubT
on ParT.levelId = sub.parentLevelId

Open in new window

0
devdeptAuthor Commented:
BrandonGalderisi:

i am using this query, from this its coming upto 3 levels, i want to display n levels.

SELECT BB.LavelName, B.LavelName, E.LavelName
FROM groupslevel e
INNER JOIN groupslevel AS B ON E.LevelParentID=B.levelID
INNER JOIN groupslevel BB ON B.levelparentID=BB.LevelID
0
BrandonGalderisiCommented:
devdept:
I assume you have found something that works for you at this point.

If by some chance no, then I can still help.

Otherwise, my recomendation is Delete-Refund.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.