Ya beat me to it, John. 🙂
Not 100% sure but, using your good data, I think example 1 was meant to be something on the order of...
-- Example 1
DECLARE @EMail VARCHAR(8000)
SELECT @EMail = COALESCE(@EMail + ', ', '') + t1.ColumnB
FROM dbo.Table1 t1
INNER JOIN dbo.Table2 t2 ON t1.ColumnA = t2.ColumnA
WHERE t2.ColumnD = 'EMail'
SELECT @EMail
GO
...and the output was meant to be something like this...
---------------------------------------------------------------------------------------------------------------------------------
Michael.Jordan@domain.com, Lebron.James@domain.com, Kobe.Bryant@domain.com, Earvin.Johnson@domain.com, Charles.Barkely@domain.com
(1 row(s) affected)
--Jeff Moden
Change is inevitable... Change for the better is not.