标签:value turn table path varchar create split 字符串 tab
//根据一个以逗号分隔的字符串,查出一张表的 Name 用逗号分隔
CREATE function [dbo].[function_name](@platformids nvarchar(200))
returns varchar(180)
AS
BEGIN
declare @name varchar(180);
select @name=stuff((select ‘,‘+c.PlatformName from
(SELECT a.Value,b.PlatformName FROM dbo.fn_Split1(@platformids,‘,‘)
AS a INNER JOIN dbo.Order_PlatformTable AS b on b.id=a.Value) AS c for xml path (‘‘)),1,1,‘‘)
return @name;
END
标签:value turn table path varchar create split 字符串 tab
原文地址:http://www.cnblogs.com/xiaojian1/p/6480269.html