Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indentation

Status
Not open for further replies.
Oct 11, 2006
300
US
Hi,

In the process of building a nested table from a adjancency table, I built indentation that would show the the hierarchy of the people in the org structure. So I have got rows with values like this:

Indentation Employee
1 4655
2 5623
2 8956
2 5629
2 5627
3 5986
3 8549

The query that got that the above result is:

Code:
SELECT     TOP 100 PERCENT COUNT(s2.employee) AS indentation, s1.employee
FROM         dbo.Stack1 s1 CROSS JOIN
                      dbo.Stack1 s2
WHERE     (s1.Lft BETWEEN s2.Lft AND s2.Rgt)
GROUP BY s1.employee
ORDER BY COUNT(s2.employee)

Now how can i use this indentation to show the employees indented respectively in my web browser?

Thanks.
 
I think that should be done on your front end.

Good Luck,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top