Here's a dummy db layout;tblNews - NEWS_ID (int), NEWS_Name (varchar)tblLinkNewsLocation - LINK_NewsID (int), LINK_LocationID (int)tblLocations - LOCATION_ID (int), LOCATION_Name (varchar)
Simple stuff, each News item can have multiple locations. I'm using a stored procedure to the following query; SELECT News_Name, LOCATION_Name FROM tblNews INNER JOINtblLinkNewsLocation ON tblNews.NEWS_ID = tblLinkNewsLocation.LINK_NewsID INNER JOINtblLocations ON tblLinkNewsLocation.LINK_LocationID = tblLocations_LocationID
This pulls out something likeNEWS_Name Location_Name-------------------------------------NewsItem1 EnglandNewsItem1 ScotlandNewsItem1 WalesNewsItem2 ScotlandNewsItem2 Ireland-------------------------------------
etc.What I want to be able to do, instead of pulling out repeats of each news item for each location, is pull out a comma-seperated string of all their locations. I.e.NEWS_Name Locations-----------------------------------------"NewsItem1" "England, Scotland, Wales""NewsItem2" "Scotland, Ireland"-----------------------------------------
Possible? I was thinking something along the lines of calling another stored procedure, which returns all the locations for one job, and then somehow formatting the result of that stored procedure inside the main stored procedure.... but that's as far as I get :DAny ideas on this, or a better solution to the problem, greatly appreciated.Edited by - DaCheese on 07/10/2002 08:34:20