Hi All,
I have the data as below (sales order information including customer, their order, order line and item ordered). I want to turn this data into XML format into groups i.e. One group per account and then within the account another group is for the order number.
select 'A1' account, 1 orderno, 1 lineno, 'I1' item from dual union all
select 'A1' account, 1 orderno, 2 lineno, 'I2' item from dual union all
select 'A2' account, 2 orderno, 1 lineno, 'I1' item from dual union all
select 'A2' account, 2 orderno, 2 lineno, 'I2' item from dual union all
select 'A3' account, 3 orderno, 1 lineno, 'I1' item from dual union all
select 'A3' account, 3 orderno, 2 lineno, 'I2' item from dual
<account account=A1>
<orderno orderno=1>
<lineno> 1</lineno>
<item> I1 </item>
<lineno> 2</lineno>
<item> I2 </item>
</orderno>
</account>
<account account=A2>
<orderno orderno=2>
<lineno> 1</lineno>
<item> I1 </item>
<lineno> 2</lineno>
<item> I2 </item>
</orderno>
</account>