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.
| Author |
Topic |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2005-03-23 : 12:22:59
|
| hello,I would like to select all occurences of a certain value as one output. ie a CSV columneg SELECT nickname,phone_numberFROM sms_phonebookWHERE phone_number in ('5342543,2345234523,523452435') and username = helloI would like to show the results in one column, with as a CSV thanks |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-23 : 12:32:18
|
declare @ListSELECT @List = coalesce(@List, '') + nickname + ' ' + phone_numberFROM sms_phonebookWHERE phone_number in ('5342543','2345234523','523452435') and username = helloSELECT @ListGo with the flow & have fun! Else fight the flow |
 |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2005-03-23 : 12:38:03
|
| What amazes me about this forum is not the precise answer i get, but the speed at which all threads are answerd.Thanks SpiritAfrika |
 |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2005-03-23 : 12:51:24
|
| One more question, How do i implement this in an ASP page, query ? As a SP ?thanks |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-03-23 : 13:09:29
|
a user defined function that returns varchar(8000)Go with the flow & have fun! Else fight the flow |
 |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2005-03-23 : 13:15:05
|
| Ok thanks |
 |
|
|
|
|
|