Hei guys, i found this site very helpful and maybe you can help me this time.
I tried to use Stuff function but it doesnt retreive what i expect and i dont know what im doing wrong. i have this table and i need to fill in the column "Concatenate"
As you can see for every distinct Final Hunter Match, i have different Ops ID's. I need to concatenate these Ops Id's into the last column. this is what i have so far:
select [Final Hunter Match],[Ops Id],[Number], stuff ((select ','+ [Concatenate]
from table t2
where t2.[Final Hunter Match]=t1.[Final Hunter Match]
for XML path ('')),1,1,'')as [Col1]
from [dbo].table t1