日期:2014-05-16 浏览次数:20551 次
select [str]=stuff((select ','+ltrim(id)from a,b where charindex(','+a.name+',',','+b.name+',')>0for xml path('')), 1, 1, '') from b
select [str]=stuff((select ','+ltrim(id)from a,b where charindex(','+a.name+',',','+b.name+',')>0 for xml path('')), 1, 1, '') from b