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)
 comma delimited string - extended to return multiple rows.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-07-13 : 09:28:41
Varsha writes "I have read the 'Using Coalesce to build comma delimited string'in your site. This returns a single comma separated string. What I was looking for is someting like this from SQL:

COUNTRY CITY

India Bangalore,Mumbai,Delhi

US NewYork,Miami,Chicago

returned from the same query. Someting like using a group by for the 'Country'. Specifying 'Where Country = US' in the where clause will return me only cities for US.

All the cities are in separate rows in the table.This needs to be combined in a comma delimited string.

Any help is much appreciated.

Thanks!"

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-07-13 : 09:34:36
Did u try the following :
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx



Srinika
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-07-13 : 09:39:17
or If you use front end application, do concatenation there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -