Hierarchy based aggregation
- by Ganapathy Subramaniam
I have a hierarchy table in SQL Server 2005 which contains employees - managers - department - location - state.
Sample table for hierarchy table:
ID Name ParentID Type
1 PA NULL 0 (group)
2 Pittsburgh 1 1 (subgroup)
3 Accounts 2 1
4 Alex 3 2 (employee)
5 Robin 3 2
6 HR …