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 |
|
bluefishclock
Starting Member
2 Posts |
Posted - 2009-03-16 : 14:15:17
|
| Question:Input :OrderNo Batch1111 10011111 10021111 10032222 20012222 2002Write a SQL query which produces the following outputOrderNo Batch1111 1001, 1002, 10032222 2001, 2002 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
bluefishclock
Starting Member
2 Posts |
Posted - 2009-03-16 : 14:31:20
|
| thank you, and will do |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2009-03-17 : 05:58:43
|
| moved from script library___________________________________________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.5 out! |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-03-17 : 06:39:47
|
| if u using 2005 u can useselect orderno, stuff((select ','+batch from tablename where orderno = t.orderno for xml path('')),1,1,'')as batch from tablename t |
 |
|
|
|
|
|