Susane
SSC-Addicted
Points: 491
More actions
March 29, 2007 at 10:04 am
#172611
hi i have the below question , but not sure how to write the code , iam a new b ,can somebody help me out please
a 1
a 2
a 3
b 1
i want the results to be
a 1,2,3
David McFarland
SSChampion
Points: 11815
March 29, 2007 at 11:05 am
#697696
This has got to be one of the most frequently asked questions, and there is likely an article on it (which if I find, I'll start linking to), but in the meantime, here is an example of how it can be done.
zubamark
Right there with Babe
Points: 735
March 30, 2007 at 2:07 pm
#697936
May be it will help!
USE pubs
GO
DECLARE @title_ids varchar(8000), @delimiter char
SET @delimiter = ','
SELECT @title_ids = COALESCE(@title_ids + @delimiter, '') + title_id FROM titles
SELECT @title_ids AS [List of Title IDs]
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply