tbl_test
ColA ColB
1 x
2 y
3 z
4 m
5 n
DECLARE @STR VARCHAR(1000)
SELECT @STR = (CASE WHEN @STR IS NULL THEN ColB ELSE @STR + ', ' + ColB END)
FROM tbl_test
SELECT @STR AS ColB
ColB
x, y, z, m, n
Thursday, November 11, 2010
Subscribe to:
Posts (Atom)