发布网友 发布时间:2022-04-23 06:58
共2个回答
懂视网 时间:2022-05-01 21:35
//根据一个以逗号分隔的字符串,查出一张表的 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
sql根据字符串id得到name
标签:value turn table path varchar create split 字符串 tab
热心网友 时间:2022-05-01 18:43
select a.No,b.name,c.name,d.name From 表A a
left join 表B b on a.id1=b.id
left join 表B c on a.id2=c.id
left join 表B d on a.id3=d.id