想把数据表某一字段值,全串连起来,你可以使用一个方法。COALESCE:
DECLARE @list NVARCHAR(MAX)SELECT @list = COALESCE(@list + ',','') + [Transportation_CN] FROM [dbo].[Transportation]SELECT @list
Source Code
使用示例来演示:
想把数据表某一字段值,全串连起来,你可以使用一个方法。COALESCE:
DECLARE @list NVARCHAR(MAX)SELECT @list = COALESCE(@list + ',','') + [Transportation_CN] FROM [dbo].[Transportation]SELECT @list
Source Code
使用示例来演示: