SqlServer2005 合并两个字符串的方法

来源:互联网 发布:java mvc框架理解 编辑:程序博客网 时间:2024/05/23 13:36
 select distinct * from
(
select ijo_no,pmat_name,pmat_id=stuff((select '/'+pmat_id from (select * from @addTable ) a where a.ijo_no=b.ijo_no and a.pmat_name=b.pmat_name and a.qty=b.qty for xml path ('')),1,1,''),qty from @addTable b 
--where b.ijo_no='HLI110101143-1A'
) a
0 0