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)
 Multiple rows into a single row

Author  Topic 

pssumesh2003
Starting Member

35 Posts

Posted - 2010-03-22 : 06:56:38
Hi everybody,

In one of my project a table like

TID Location
1 Newyork
2 Sidney
2 Tokyo
2 Berlin
1 Mumbai
3 Beijing


i wnat a query to select above table as

TID Newcolumn
----- ---------
1 Newyork,Mumbai
2 Sidney,Tokyo,Berlin
3 Bijing


Plz help me?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-22 : 06:59:51
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254

Madhivanan

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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-22 : 11:50:11
see scenario 3 here

http://visakhm.blogspot.com/2010/01/multipurpose-apply-operator.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -