//根据一个以逗号分隔的字符串,查出一张表的 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
时间: 2024-11-06 23:54:15