--Editing this as my question was marked as a duplicate. I'm having an issue implementing STUFF and the "trick" FOR XML PATH when my query contains a join.
I have a single column that I have been trying to convert to a single column and single row. The data structure returned from the query below is:
col1
1
2
3
I'd like it to be comma delimited like so: col1 1,2,3
The query I have is as follows:
select
u_id
from
tabl1 tb
inner join CTEE f on f.aid = tb.a_id
group by
u_id
I tried to incorporate STUFF and a FOR XML PATH in this query but keep failing to do so. Can anyone point me in the right direction. I've done this for multiple columns when concatenating rows into a comma delimited column, but for some reason this is driving me crazy.