all groups > sql server programming > september 2006 >
You're in the

sql server programming

group:

How to select a single varchar combined by many rows?


How to select a single varchar combined by many rows? Cylix
9/14/2006 8:09:06 PM
sql server programming: This question is quite common in my query, but I still have no idea
about that.

For example,
My client have a number of companies, each company has its own phone
number.
Each phone number is store in row(not fixed number of row).

Let say, there are 4 phone number (row) as
852 3745 3844
86 1235 4578
88 481 2356 759
97 124 457 4134

How can I select a single cell like "852 3745 3844, 86 1235 4578, 88
481 2356 759, 97 124 457 4134"

OR Select it as single row with four columns?

Thank you.
Re: How to select a single varchar combined by many rows? Cylix
9/14/2006 9:36:14 PM
Thanks Aaron,
The SQL is really interest and advance for me.
It do really help.
Re: How to select a single varchar combined by many rows? Aaron Bertrand [SQL Server MVP]
9/14/2006 11:47:33 PM
Why can't the presentation tier do this?
http://databases.aspfaq.com/general/how-do-i-concatenate-strings-from-a-column-into-a-single-row.html



[quoted text, click to view]

Re: How to select a single varchar combined by many rows? SQL Ken
9/15/2006 12:20:35 AM

[quoted text, click to view]
AddThis Social Bookmark Button