I need to build a query to resolve this scenario below:
ParentTable:
ParentId Name
1 Parent A
2 Parent B
ChildTable:
ChildId ParentId Name
10 1 Child X
11 1 Child Y
12 1 Child Z
13 2 Child Q
Where a single parent can be linked to multiple children. The query then would give the following result:
Parent Name 1st-Child 2nd-Child 3rd-Child 4th-Child 5th-Child
Parent A Child X Child Y Child Z
Parent B Child Q
Is this possible in MS SQL 2008?
Assuming you only ever need to list 5 children, this query will work: