grouping of query data in xml

Поиск
Список
Период
Сортировка
От c k
Тема grouping of query data in xml
Дата
Msg-id CAN2Y=uNKurwSBxdEpKDTTORCnfxordBaxc2yaRVn5amtaW-r3w@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] grouping of query data in xml  ("David Johnston" <polobo@yahoo.com>)
Re: [GENERAL] grouping of query data in xml  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-admin
Hi friends,

I am working with some xml exporting functionality of our application. I am testing query_to_xml function supported in PostgreSQL 9.1. XML output should be
 <accgroup>
  <accgroupid>1</accgroupid>
  <accgroupname>COMPANY ACCOUNT</accgroupname>
 <docs>
  <refaccdocid>638168</refaccdocid>
  <debit>10000.0000</debit>
  <credit>0.0000</credit>
 </docs>
 <docs>
 <refaccdocid>638168</refaccdocid>
  <debit>0.0000</debit>
  <credit>10000.0000</credit>
  </docs>
</accgroup>

but the output is as follows:
<row>
  <accgroup>acc group</accgroup>
  <accgroupid>1</accgroupid>
  <accgroupname>COMPANY ACCOUNT</accgroupname>
  <docs>docs</docs>
  <refaccdocid>638168</refaccdocid>
  <debit>10000.0000</debit>
  <credit>0.0000</credit>
</row>

<row>
  <accgroup>acc group</accgroup>
  <accgroupid>1</accgroupid>
  <accgroupname>COMPANY ACCOUNT</accgroupname>
  <docs>docs</docs>
  <refaccdocid>638168</refaccdocid>
  <debit>0.0000</debit>
  <credit>10000.0000</credit>
</row>

How can grouping on specific columns can be done in result xml through using query_to_xml?
I am expecting help from postgresql community as always.

Thanks

CPKulkarni

В списке pgsql-admin по дате отправления:

Предыдущее
От: Jesper Krogh
Дата:
Сообщение: Force explicit transactions on insert / update
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: [GENERAL] grouping of query data in xml