May 12, 2009 at 2:06 pm
I have data in a table as below.
IDData
1A
1B
1A
2C
3A
3A
I want to return this
IDData
1A,B
2C
3A
How do I return a distinct value for the Data Column that is comma delimited? example ID 1 has A in the Data field twice but I only want it once.
May 12, 2009 at 2:14 pm
Why not have the front-end do that kind of thing? SQL isn't all that good at string manipulation.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 13, 2009 at 12:28 am
Are you using SS2K or SS2K5?
Based on the forum you posted in I assume SS2K, but need to make sure before posting a non-working/inefficient solution.
May 13, 2009 at 7:39 am
See if this article does not give you what you need.
http://www.sqlservercentral.com/articles/Test+Data/61572/
Greg
_________________________________________________________________________________________________
The glass is at one half capacity: nothing more, nothing less.
May 13, 2009 at 9:28 am
Yes we use 2000.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply