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 2005 Forums
 Transact-SQL (2005)
 Join detail table and concatenate into single fiel

Author  Topic 

geossl
Yak Posting Veteran

85 Posts

Posted - 2007-09-14 : 00:27:31
Dear All,

I would like to make a report for

Customer Purchase Item
--------- --------------
Peter_CC Soap, shaver, biscuit
Mary_AAA biscuit, soft drink

from two tables:

Customer:
CustomerId: Integer
Name: nvarchar


Purchase:
PurchaseID: Integer
CustomerID: Integer
PurchaseItem: nvarchar


Customer is the master table and the Purchase is detail table.
Is there any SQL to select the data which can concatenate all the purchase to one field?

Thanks.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-14 : 02:08:21
Yes. Have a look at this topic http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

swathigardas
Posting Yak Master

149 Posts

Posted - 2007-09-14 : 05:35:29
does each of these tables have any common column
so that u can create the report which u wanted
Go to Top of Page
   

- Advertisement -