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)
 select query including a String Concatenation from multiple rows

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-27 : 23:25:10
mike writes "I have a database of Users details who submit jobs for completion. These jobs may exist on multiple sites. When I query the database it returns the users details plus site(s) that the job exists but if the job exists in multiple sites multiple rows get returned with the same info. it's just the site thats different for each row. is there a way to concatenate all these sites for which the job exists into just one field so no matter how many sites the job exists on it will only return one row for the customer.

i.e im getting at the moment
JobNo Name Address email Site1
JobNo Name Address email Site2
JobNo Name Address email Site3
JobNo Name Address email Site4

i would like
JobNo Name Address email {Site1, Site2, Site3, Site4}

the number of sites can vary from 1 upto about 10 depending on the customers requirements.

I'm running MS WINDOWS 2000 SERVER + SQL SERVER 7 SP3

Thanks for your help"
   

- Advertisement -