Possible Duplicate:
SQL Server: Can I Comma Delimit Multiple Rows Into One Column?
I have a query like this:
SELECT name from users
and it's result is a number of records:
1 user1
2 user2
3 user3
I want to get all this records in a single line separated by comma:
user1, user2, user3
and an empty line if query result is empty.
How to get this using T-SQL
? UNPIVOT
?