Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
pradeep_iete
Yak Posting Veteran
84 Posts |
Posted - 2008-11-08 : 00:47:44
|
| Hello Guys , I have a view like this celebID-------- subcategoryID 34 -------- 2 34----------3 12---------4 15---------9I want my result shud be RESULT SET : celebID----------subcategoryID 34 ---------------2,3 12-----------------4 15----------------9 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-08 : 01:01:17
|
| [code]SELECT DISTINCT celebID,STUFF((SELECT ',' + CAST (subcategoryID as varchar(4)) FROM YourView WHERE celebID=v.celebID FOR XML PATH('')),1,1,'') AS subcategoryIDFROM YourView v[/code] |
 |
|
|
|
|
|