Based on the
answer[
^] to a similar
question[
^] I think the query should look something like this:
SELECT REPLACE(RTRIM((SELECT SerialNumber + ' ' FROM myTable
WHERE (ProductNumber = T.ProductNumber)
FOR XML PATH (''))),' ',';'),
ProductNumber, SUM(ProductQuanity) AS Quantity
FROM myTable T
GROUP BY ProductNumber