Re: xml output
От | Thom Brown |
---|---|
Тема | Re: xml output |
Дата | |
Msg-id | AANLkTikzQyUqXd_4_O9N0TtsbJ6b2wr8HgiRJAe8U6Gm@mail.gmail.com обсуждение исходный текст |
Ответ на | xml output (Florian Henge <florian.henge82@web.de>) |
Ответы |
Re: xml output
|
Список | pgsql-novice |
On 23 August 2010 12:33, Florian Henge <florian.henge82@web.de> wrote:
hi there!
i wanted to ask how to get an xml output from a table like this:
<words>
<first_name>joe</first_name>
<first_name>ian</first_name>
<first_name>carl</first_name>
<first_name>ben</first_name>
</words>
what i have is the following:SELECT xmlelement(name words,xmlforest(nachname))FROM personSELECT
xmlelement(name words,
xmlforest(nachname))
FROM person
but that gives me this:
<words><first_name>joe</first_name></words>
<words><first_name>ian</first_name></words>
<words><first_name>carl</first_name></words>
<words><first_name>ben</first_name></words>
thanks in advance!
bye, flo
You need to use xmlagg:
SELECT
xmlelement(name words,
xmlagg(
xmlforest(first_name)
)
)
FROM person
Regards
--
Thom Brown
Registered Linux user: #516935
В списке pgsql-novice по дате отправления: