I have this current output:
ID | Date | Products
-------------------------------------
01 | 02-18-2015 | Product A
02 | 02-18-2015 | Product B
02 | 02-18-2015 | Product C
But I want to have this:
ID | Date | Products
-------------------------------------
01 | 02-18-2015 | Product A
02 | 02-18-2015 | Product B, Product C
Some part of the code in SQL:
SELECT *
INTO #tempA
FROM
(SELECT
INV.ID, INV.Date
FROM
TblA INV) a
SELECT
b.ID, b.Date, b.Products
INTO #tempB
FROM
(SELECT z.ID,z.Date,z.Products
FROM
(SELECT
#tempA.ID, #tempA.Date, PR.Items AS Products
FROM #tempA
INNER JOIN Items PR ON ... ) z
) b
I hope someone can help me solve this specific problem.