1.sql2000中只能用自定义的函数解决 )) , 'aa') , 'bb') , 'aaa') , 'bbb') , 'ccc') go )) ) as begin ) select @str = isnull(@str + ',' , '') + cast(value as varchar) from tb where id = @id return @str end go --调用函数 select id , value = dbo.f_str(id) from tb group by…