Если это SQL Server 2017, вы можете использовать string_agg , как показано ниже:
select [PoRequestLineKey],
string_agg([priceband], ', ') AS priceband
from [mpp].[WindowSpecific] WS
JOIN [nbi].[WebDomainPriceBand] WDP ON
WS.PriceBandKey = WDP.ID
Group by [PoRequestLineKey]
Для более старых версий:
SELECT [PoRequestLineKey],
STUFF((
SELECT ', ' + WDP2.[priceband]
FROM [nbi].[WebDomainPriceBand] WDP2
WHERE WS.PriceBandKey = WDP2.ID
FOR XML PATH(''),TYPE).value('(./text())[1]','VARCHAR(MAX)'),1,2,'') AS priceband
from [mpp].[WindowSpecific] WS
JOIN [nbi].[WebDomainPriceBand] WDP ON
WS.PriceBandKey = WDP.ID
Group by [PoRequestLineKey]