tsql - Aggregation on Hierarchy Data types -


i've been reading hierarchy data type in ms sql2012. i'm trying store organisation data structure values @ each level. i'm wondering how aggregate data associated hierarchy data column.

for instance want sum 3 levels top of hierarchy, use that. use group or roll-up or there new function use on hierarchy data type.

to sum 3 levels looks use getlevel per link

http://technet.microsoft.com/en-us/3b4f7dae-65b5-4d8d-8641-87aba9aa692d http://msdn.microsoft.com/en-au/library/bb677197(v=sql.100).aspx

select sum(z) humanresources.employeeorg orgnode.getlevel() between 0 , 2 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -