I just saw another question very similar to this!
Here is the canonical NORTHWIND (spelled just slightly different for some reason) database example.
SELECT *
FROM [NORTHWND].[dbo].[Products]
SELECT CategoryId,
MAX( CASE seq WHEN 1 THEN ProductName ELSE '' END ) + ', ' +
MAX( CASE seq WHEN 2 THEN ProductName ELSE '' END ) + ', ' +
MAX( CASE seq WHEN 3 THEN ProductName ELSE '' END ) + ', ' +
MAX( CASE seq WHEN 4 THEN ProductName ELSE '' END )
FROM ( SELECT p1.CategoryId, p1.ProductName,
( SELECT COUNT(*)
FROM NORTHWND.dbo.Products p2
WHERE p2.CategoryId = p1.CategoryId
AND p2.ProductName <= p1.ProductName )
FROM NORTHWND.dbo.Products p1 ) D ( CategoryId, ProductName, seq )
GROUP BY CategoryId ;