Concatenate the column values together

Posted by Ddd under Sql Server category on | Points: 40 | Views : 1702
This code will display 1,2,3,4,5,6,7,8 in one cell in the resultset
result will be the heading of the column

@a varchar(100)
select @a=COALESCE(@a + ',', '') +convert(varchar(3),categoryid) from categories
select result=@a

Comments or Responses

Login to post response