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)
 T-SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-03-02 : 08:50:03
Jaiprakash writes "select shortname from groups where groupid in (select groupid from groupstomembers where memid=66)

here groups and groupstomembers are table. Now this query may return more than one result. But i am using this query as a subquery to another query. So i want the result to be concat as a single string. As for example:Suppose the result returned

shortname
1.ABC
2.DEF

Then i want it like this ABC,DEF ie as a sinngle string.

Thanks,"

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-02 : 09:31:05
Yes, this is possible and have been asked almost two million times here at SQLTeam.
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx

Sorry Peter. Had to borrow your quote again



KH

Go to Top of Page
   

- Advertisement -