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 |
|
zubamark
Starting Member
23 Posts |
Posted - 2008-06-13 : 15:55:42
|
| id name--- -----------------236 SERVICE REQUEST236 HARDWARE236 Desktop336 Loanid name-- ----------------------------236 SERVICE REQUEST/ HARDWARE/ Desktop/Laptop/ Loan |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-14 : 00:51:10
|
| [code]SELECT t.id,LEFT(nl.namelist,LEN(nl.namelist)-1) AS nameFROM (SELECT DISTINCT id FROM YourTable) tCROSS APPLY (SELECT name + '/' AS [text()] FROM YourTable WHERE id=t.id FOR XML PATH(''))nl(namelist)[/code] |
 |
|
|
zubamark
Starting Member
23 Posts |
Posted - 2008-06-16 : 10:43:28
|
| It works only with 1 id, but I need to have multiple ids. |
 |
|
|
zubamark
Starting Member
23 Posts |
Posted - 2008-06-16 : 10:45:14
|
| This is SQL SERVER 2000 and XML PATH is no good. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|