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
 SQL Server Development (2000)
 Concatenate row values into one field

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-14 : 09:22:00
Carl writes "If you want to create a web report, based on a table that has a one-to-many relationship with another, how can you condense all the many values in the many table into one field on the one table (for display only)

For example, you have a table of Rep names, and they have responsibilities for many Countries. This could be stored in the database as a Rep table and a RepCountry table, with a one-to-many relationship between them.

I want to efficiently list them all like this :


Rep Name Countries
---------- -------------------------
Joe Bloggs France, Belgium, Holland
Fred Smith UK, Ireland
Jack Jones Germany, Denmark
"

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2002-03-14 : 12:46:10
search for CSV (comma seperate variables) on this site....comes up loads of times....maybe even in the FAQ.

Go to Top of Page
   

- Advertisement -