首页 > 其他 > 详细

字符串合并与分解

时间:2019-12-09 10:11:31      阅读:71      评论:0      收藏:0      [点我收藏+]

 

字符串合并与分解

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,‘‘)

 

 

字符串合并与分解

原文:https://www.cnblogs.com/Rain635926522/p/12008937.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!