I'm using DB2 for z/OS V10.
I need to select some data from a DB2 table direcly into XML with grouping the data on more then 1 level like the following example
<actionCodeGrp>
<actionCode>A</actionCode>
<ISINGrp>
<ISIN>DE0000000001</ISIN>
<NAME>ISIN-DE-1</NAME>
<ISSUER>AAA</ISSUER>
</ISINGrp>
<ISINGrp>
<ISIN>DE0000000002</ISIN>
<NAME>ISIN-DE-2</NAME>
<ISSUER>BBB</ISSUER>
</ISINGrp>
</actionCodeGrp>
<actionCodeGrp>
<actionCode>B</actionCode>
<ISINGrp>
<ISIN>DE0000000003</ISIN>
<NAME>ISIN-DE-3</NAME>
<ISSUER>CCC</ISSUER>
</ISINGrp>
<ISINGrp>
<ISIN>DE0000000004</ISIN>
<NAME>ISIN-DE-4</NAME>
<ISSUER>DDD</ISSUER>
</ISINGrp>
</actionCodeGrp>
The columns named above are all part of the same relational table. All examples I found were only with max. one group by clause and I have no idea how to write a more complex query. Can someone help?