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
 Transact-SQL (2000)
 In SQL Query - how to display multiple records in 1 row

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-04-06 : 20:06:55
Barbara writes "We have a table that has multiple records/rows where all 7 columns are the same because there is one column that is different. For example... User Location Table. Columns include:
UserName
Location

Records in table could have multiple records per user:
Barbara Arizona
Barbara Las Vegas
Barbara New York
Mary Arizona
Mary Texas

Is there a way in sql code to write that so that I don't get the records repeated over and over. Just would get:
Barbara Arizona, Las Vegas, New York

Could gather all the locations where username = Barbara and concatentate them or group them into one for dislay purposes??

Thanks
Barbara"

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-06 : 21:34:11
yes. See here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=56058



KH


Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-07 : 01:26:08
Also refer http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx?Pending=true

Madhivanan

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

- Advertisement -