I have 2 tables
Master
-------
Field1
Field2
Child
-----
Field1
Field2
MasterField1
I want a single query which give results something like
Master Child
----------------------------------------------------
Master1 Child1, Child2, Child3
Master2 Child1, Child2, Child3, Child4
Master3 Child1, Child2
& So on
There are 3 posibility to generate above data
1. Create User Defined function pass master key & return string
2. Declare cursor loop around master table
Generate child string
Append to temp table
3. Create Temp Table,
Apped Master data with identity field
Loop around temp table (Cursor not reqd in this case)
Generate child string
Append to another temp table
If anybody have other than above, let me know
Is there any possibility where in single Query i can return data something like above?
As i am concern for performance, if i used any of the above solution.
Which will have minimum performance hit?
Thanks in advance