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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 grouping sql problem.

Author  Topic 

dpais
Yak Posting Veteran

60 Posts

Posted - 2008-10-24 : 15:08:20
[code]

here is my input table .......

part whereused
100567 600233
100567 600234
100567 600235
100567 600236
100600 600235
100600 600260
100600 600270


need output to be like ......

part whereused
100567 600233 600234 600235 600236
100600 600235 600260 600270


the output whereused consist of all the whereused grouped by parts with a space between each whereused.

ddl is below --

create table #test(cur_dt varchar(20), ship varchar(20))
insert #test
select '100567','600234' union
select '100567','600233' union
select '100567','600235' union
select '100567','600236' union
select '100600','600235' union
select '100600','600270' union
select '100600','600260' union

thank you.

[/code]

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-24 : 15:44:49
Search this site for many concatenating functions.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

dpais
Yak Posting Veteran

60 Posts

Posted - 2008-10-24 : 15:52:53
quote:
Originally posted by Peso

Search this site for many concatenating functions.



E 12°55'05.63"
N 56°04'39.26"




Hi Peso thanks for the reply -
i know how to concatenate - i'm having problems with the grouping ...
further help is appreciated.
thanks.
Go to Top of Page

dpais
Yak Posting Veteran

60 Posts

Posted - 2008-10-24 : 16:00:59
got it .... reply to post

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53293

answers my question.

thanks peso.
Go to Top of Page
   

- Advertisement -