我有以下SQL ...
SELECT 'TESTPRODUCT' AS Product_Code,Colours.Name FROM Product p
LEFT OUTER JOIN
(
SELECT col.Product_Id,colo.Name from ProductColour colo INNER JOIN
Product__Colour col on colo.ProductColour_Id = col.ProductColour_Id
group by col.Product_Id,colo.Name
) Colours
ON p.Product_Id = Colours.Product_Id
WHERE Product_Code = 'TESTPRODUCT'
我的问题是它返回......
Product_Code Name
TESTPRODUCT Black
TESTPRODUCT Blue
TESTPRODUCT Silver
我需要做的是......
Product_Code Name1 Name2 Name3
TESTPRODUCT Black Blue Silver
关于如何实现这一目标的任何想法?