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 |
|
vbc22
Starting Member
4 Posts |
Posted - 2006-07-24 : 00:11:02
|
Hello,I'm new and would like your help on the following:Table 1workOrder (PK), modified, created, userTable 2itemID (PK), workOrderID (FK), modified, created, userIs it possible to write a query that will return a single string to represent the one-to-many itemIDs belonging to a single workOrder?The end-result recordset I am looking to ascertain is:workOrder itemsw001 i01w002 i23, i39, i01 <--- multiple items work orderw003 i88 The reason why I am seeking help on this is because I don't want to use the query I presently have that duplicates each work order that has more than one item. Instead, I'd like to be able summarize all the items as a string with the itemID's concatenated, as illustrated above.Is this possible?I would really appreciate any solutions or guidance to reference material to solve this problem.Regards. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
vbc22
Starting Member
4 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-07-24 : 11:24:04
|
| Note that if concatenated string exceeds 8000 characters you should use more than one variable. If possible do concatenation in front end applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|