|
Home > Archive > MS SQL XML > December 2006 > Retrieve records separated by spaces
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Retrieve records separated by spaces
|
|
|
| Hello
I want to retrieve some records separated by spaces. Do you have any idea?
For example,
select col from T for xml path(''), root('x')
You get
<x>
<col>abc</col>
<col>def</col>
.......
</x>
However I want to get,
<x>abc def ghi ... </x>
| |
|
| After post I got an idea, but looking for better one.
select @x=(select col from T for xml path(''))
select @x.query('
for $a in /col
return (concat(/$a/text(), " "))
')
for xml path
Any idea will be appreciated.
"Han" <hp4444@kornet.net.korea> wrote in message
news:%233fljmVFHHA.4652@TK2MSFTNGP04.phx.gbl...
> Hello
>
> I want to retrieve some records separated by spaces. Do you have any idea?
>
> For example,
>
> select col from T for xml path(''), root('x')
>
> You get
>
> <x>
> <col>abc</col>
> <col>def</col>
> ......
> </x>
>
> However I want to get,
>
> <x>abc def ghi ... </x>
>
|
|
|
|
|