标签:ar sp on bs ef as har nbsp rom
原理就是把找到的结果一直添加到一个声明的字段中,然后在查出来
declare @output varchar(8000)
select @output=coalesce(@output,‘‘)+ product+‘,‘
from khinfoyxcp
select left(@output,len(@output)-1)
declare @output varchar(8000),@khmc varchar(100)
select @khmc=kd_khmc,@output=coalesce(@output,‘‘)+ product+‘,‘
from khinfo a inner join khinfoyxcp b on a.pid=b.pid
select @khmc as khmc,left(@output,len(@output)-1) as [output] into #b
标签:ar sp on bs ef as har nbsp rom
原文地址:http://www.cnblogs.com/chlf/p/4049755.html