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)
 Query with repeating data

Author  Topic 

ekb18c
Starting Member

18 Posts

Posted - 2007-06-20 : 12:50:54
I have a table

[employee]
name - office address - office city - office zip


Data:
mark johnson - 123 stone street - washington - 13453
mark johnson - 456 sw east street - miami - 21345
mark johnson - 234 67 street - new jersey - 23423
John lee - 3425 46 street - new york - 10034
fred mack - 1 east chester road - boston - 33533


How do I get a query to do this..

Mark Johnson - 123 stone street~456 sw east street~234 67 street


the ~ seperates the address data points.

Can someone shed some light?


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-06-20 : 19:12:31
see http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-21 : 10:27:59
Note that if the concatenated string exceeds 8000 characters you need to use more than one variable
Where do you want to show data?

Madhivanan

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

ekb18c
Starting Member

18 Posts

Posted - 2007-06-21 : 10:59:25
thanks! that helped!
Go to Top of Page
   

- Advertisement -