October 23, 2011 at 1:19 am
I have a table A that contains a ID and value column, the primary key is set on this 2 columns.
Table A
Column ID varchar(10)
Column Value int
Values
ID Value
A100 100
B100 100
A100 200
B100 300
A100 400
C100 500
I want a sql that display values in the following format
ID Result
A100 100,200,400
B100 100,300
C100 500
Can any one help me to generate this report
Thanks,
October 23, 2011 at 1:59 am
October 23, 2011 at 2:40 am
I guess it's more an issue of getting a comma delimited list instead of pivoted data.
If that's the case, the FOR XML PATH approach as demonstrated here might be more towards the expected result.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply