SQL Server provides a function named Coalesce to do the task to join all the column value by comma separated string.
The Query is below:
Go
Declare @strEmail varchar(max)
SELECT @strEmail=coalesce(@strEmail+',','')+[Email]
FROM Users
print @strEmail
No comments:
Post a Comment