boggyboy
Yak Posting Veteran
57 Posts |
Posted - 2013-01-28 : 08:23:35
|
I have hierarchal data that looks like below with parent/child relationships defined.Item,ID, ParentIDCEO, 1, nullCIO, 2, 1COO, 3, 1VP of Dev, 4, 2VP of Infrastructure, 5, 2VP of Marketing, 6, 3VP of Support, 7, 2VP of Sales, 8, 3Sales Executive 1, 9, 8Sales Executive 2, 10, 8Marketing Executive 1, 11, 6Marketing Executive 2, 12, 6Dev Executive 1, 13, 4Dev Executive 2, 14, 4I want to return the following:Item,ID, ParentIDCEO, 1, null,CEOCIO, 2, 1,CEO.CIOCOO, 3, 1,CEO.COOVP of Dev, 4, 2,CEO.COO.VP of DevVP of Infrastructure, 5, 2, CEO.COO.VP of InfrastructureVP of Marketing, 6, 3, CEO.COO.VP of MarketingVP of Support, 7, 2, CEO.COO.VP of SupportVP of Sales, 8, 3,CEO.COO.VP of SalesSales Executive 1, 9, 8, CEO.COO.VP of Sales.Sales Executive 1and so on... where the new column is the full "Dot" notation I need some kind of recursive query. Thanks in advance!Meghan |
|