Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combine fields into one cell

Status
Not open for further replies.

ksbigfoot

Programmer
Joined
Apr 15, 2002
Messages
856
Location
CA
I am using SQL Server 2005.

I have 5 rows
1st row contains the address (address column)
2nd - 5th row contains a phone number (phone column)

Eg.)
ID ParentID Address Phone
1 Null 1234 Home Street Null
2 1 Null 555-5551
3 1 Null 555-5552
4 1 Null 555-5553
5 1 Null 555-5554

Is there a way to write a Stored Proc / view / Sql statement that would return the values as

Result should return one row for the ID value = 1
1234 Home Street in the first cell
555-5551, 555-5552, 555-5553, 555-5554 in the second cell

Thanks
 
Look here: thread183-1159740

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Howdy George,
Thanks for the redirecton.
I will let you know if that works for me.
Thanks again,
ksbigfoot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top