Link to home
Start Free TrialLog in
Avatar of devdept
devdeptFlag for Saudi Arabia

asked on

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
Avatar of BrandonGalderisi
BrandonGalderisi
Flag of United States of America image

I'm not sure what the question is!
Avatar of devdept

ASKER

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.
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

Avatar of devdept

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of BrandonGalderisi
BrandonGalderisi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial