[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

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
0
devdept
Asked:
devdept
  • 3
  • 2
1 Solution
 
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now