Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible...?
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Is it possible...?
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01383774
Message ID:
01383774
Views:
125
...given this dataset:
RowDate	RowId	CommentID
2/11/09	BB2	IL 5093
2/11/09	RO1	IL 5093
2/11/09	SL1	IL 5093
2/12/09	BB1	IL 9093
2/12/09	BB2	IL 9094
2/12/09	RO1	IL 9095
2/12/09	SL1	IL 9096
2/13/09	BB2	IL 9193
2/13/09	SL1	IL 9194
...to produce this result set?
RowDate	CombinedCommentId
2/11/09	IL 5093
2/12/09	IL 9093 IL 9094 IL 9095 IL 9096
2/13/09	IL 9193 IL 9194
The obvious attempt is to generate a concatenated field out of the individual CommentId fields for rows with common RowDate. The catch is to not repeat a CommentId that might exist on multiple rows with the same RowDate. My attempts so far have resulted with repeated values for 2/11/09 in the CombinedCommentId field, that is, IL 5093 repeats three (3) times while I only desire it to appear once as in the sample result set.

Thanks in advance.
Vince
Next
Reply
Map
View

Click here to load this message in the networking platform