This would make:
Jones
Smith
Williams
Look like this:
Jones, Smith, Williams
DECLARE @all_names varchar(2000);
SELECT @all_names = COALESCE(@all_names + ', ', '') +
a.last_name
FROM customers_table a
--WHERE .... (this is optional)
SELECT @all_names as 'last_names'
No comments:
Post a Comment