Uri Dimant
4/1/2007 9:28:00 AM
People keep back what is the version they are using , so by default it
becames SQL Server 2005 :-))
"Steve Dassin" <rac4sqlnospam@net> wrote in message
news:OTcjO9CdHHA.4352@TK2MSFTNGP03.phx.gbl...
>I knew somebody would find the right path -:)
>
> "Uri Dimant" <urid@iscar.co.il> wrote in message
> news:OtPbSnCdHHA.3976@TK2MSFTNGP06.phx.gbl...
>> Ron
>> ----sql server 2005
>>
>> Use demo
>>
>> GO
>>
>> CREATE TABLE DBO.Test (ID INT,ItemNumber INT, [Type] VARCHAR(20))
>>
>> INSERT INTO DBO.Test VALUES (1,9830302,'CD')
>>
>> INSERT INTO DBO.Test VALUES (2,9830302,'Cassette')
>>
>>
>>
>> SELECT ItemNumber,
>>
>> ( SELECT m2.[Type] + ','
>>
>> FROM DBO.Test m2
>>
>> WHERE m2.ItemNumber = m1.ItemNumber
>>
>> ORDER BY [Type]
>>
>> FOR XML PATH('') ) AS [Type]
>>
>> FROM DBO.Test m1
>>
>> GROUP BY ItemNumber;
>>
>> "Ronald S. Cook" <rcook@westinis.com> wrote in message
>> news:%23kD$Gu9cHHA.984@TK2MSFTNGP04.phx.gbl...
>> > This is nasty question but...
>> >
>> > How can I take the following data from a table:
>> >
>> > ID ItemNumber Type
>> > 1 9830302 CD
>> > 2 9830302 Cassette
>> >
>> > And run a select statement to get me:
>> >
>> > ID ItemNumber Type
>> > 1 9830302 CD/Cassette
>> >
>> > Thanks,
>> > Ron
>> >
>> >
>>
>>
>
>