字符串合并与分解

 

字符串合并与分解

Select * From F_Splitstr('1,3,2,3',',') 

select stuff((
        select  distinct ','+ F1
        from F_Splitstr('1,3,2,3',',') 
        for xml path('')
    ),1,1,'')


select stuff((select distinct ','+ F1  from F_Splitstr('1,3,2,3',',') for xml path('')),1,1,'')


实际使用时的套用
	select @FProductBarCode=stuff((select distinct ','+ FProductBarCode
	from (
		select FProductBarCode
		from #tmpBarcode M
		where M.FContractNo=@FContractNo and M.FXC=@FXC
	) M
	for xml path('')),1,1,'')

  

select stuff((select distinct ','+ F1 from F_Splitstr('1,3,2,3',',') for xml path('')),1,1,'')


实际使用时的套用
select @FProductBarCode=stuff((select distinct ','+ FProductBarCode
from (
select FProductBarCode
from #tmpBarcode M
where M.FContractNo=@FContractNo and M.FXC=@FXC
) M
for xml path('')),1,1,'')

 

 

posted @ 2019-12-09 08:18  宸昊2022  阅读(187)  评论(0编辑  收藏  举报