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