SELECT * FROM ( SELECT DISTINCT ZoneEPacket FROM Logistics_Country ) A OUTER APPLY ( SELECT STUFF(( SELECT ';' + ENName FROM dbo.Logistics_Country c WHERE c.ZoneEPacket = A.ZoneEPacket FOR XML PATH('') ), 1, 1, '') AS name ) AS n;