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 |
|
amodi
Yak Posting Veteran
83 Posts |
Posted - 2009-06-21 : 04:06:35
|
| Hello friends, I have a SELECT statement, say: SELECT XYZ FROM TABLEA the output is :XYZABCD My requirement is i want the result in one record as ABCDThanks |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-06-21 : 04:10:39
|
[code]declare @result varchar(8000)select @result = ''select @result = @result + XYZ FROM TABLEA ORDER BY XYZselect @result[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
amodi
Yak Posting Veteran
83 Posts |
Posted - 2009-06-21 : 04:45:27
|
| Thanks Khtan! |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2009-06-21 : 18:36:24
|
Heh... I love it. Why doesn't anyone ask the OP why they want to denormalize data in such a fashion anymore?--Jeff Moden "Your lack of planning DOES constitute an emergency on my part... SO PLAN BETTER! ""RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row"For better, quicker answers, click on the following... [url]http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url] |
 |
|
|
|
|
|