How to create a comma delimited list using SELECT clause from table column?
USE AdventureWorks
GO
DECLARE
@listStr
VARCHAR
(
MAX
)
SELECT
@listStr =
COALESCE
(@listStr+
','
,
''
) +
Name
FROM
Production.Product
SELECT
@listStr
GO
I hope this will helpful to you
No comments:
Post a Comment