In MS SQL, you can use FOR XML, using the Stuff function to remove the redundant delimiter. Unfortunately, there is no concat function group, as with MySQL.
CREATE TABLE
INSERT INTO
'Tea', 'JohnSmith' UNION ALL SELECT
'Banana', 'GarySulvan' UNION ALL SELECT
'Water', 'JohnSmith' UNION ALL SELECT
'Candy', 'BobbySimmons' UNION ALL SELECT
'ConfecItem', 'BobbySimmons' UNION ALL SELECT
'Bread', 'JohnSmith' UNION ALL SELECT
'Soda', 'JohnSmith'
SELECT DISTINCT
ae.AccountExpert,
Stuff((
SELECT
'; ' + p.ProductName
FROM
WHERE
ae.AccountExpert = p.AccountExpert
ORDER BY
p.ProductName
FOR XML PATH('')
), 1, 2, '') AS Products
FROM
ORDER BY
ae.AccountExpert
DROP TABLE
source
share