我正在尝试将一些数据作为列而不是行返回,不确定是否可能?
所以我有以下xml:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<CashBalanceResult>
<CashBalanceLine Id="2" Name="Name1" ParentId="1" level="2">
<Balances>
<genericDate date="2012-05-21" index="0">10.000000000000</genericDate>
<genericDate date="2012-05-22" index="1">20.000000000000</genericDate>
<genericDate date="2012-05-23" index="2">30.000000000000</genericDate>
<genericDate date="2012-05-24" index="3">40.000000000000</genericDate>
<genericDate date="2012-05-25" index="4">50.000000000000</genericDate>
</Balances>
</CashBalanceLine>
<CashBalanceLine Id="170" Name="Name2" ParentId="2" level="3">
<Balances>
<genericDate date="2012-05-21" index="0">340.000000000000</genericDate>
<genericDate date="2012-05-22" index="1">440.000000000000</genericDate>
<genericDate date="2012-05-23" index="2">550.000000000000</genericDate>
<genericDate date="2012-05-24" index="3">660.000000000000</genericDate>
<genericDate date="2012-05-25" index="4">770.000000000000</genericDate>
</Balances>
</CashBalanceLine>
<CashBalanceLine Id="179" Name="Name3" ParentId="170" level="4">
<Balances>
<genericDate date="2012-05-21" index="0">5.000000000000</genericDate>
<genericDate date="2012-05-22" index="1">6.000000000000</genericDate>
<genericDate date="2012-05-23" index="2">6.000000000000</genericDate>
<genericDate date="2012-05-24" index="3">5.000000000000</genericDate>
<genericDate date="2012-05-25" index="4">6.000000000000</genericDate>
</Balances>
</CashBalanceLine>
</CashBalanceResult>
然后我尝试使 genericdate 显示为 5 列:
name,2012-05-21,2012-05-22,2012-05-23,2012-05-24,2012-05-25
Name1,10.000000000000,20.000000000000,30.000000000000,40.000000000000,50.000000000000
Name1,10.000000000000,20.000000000000,30.000000000000,40.000000000000,50.000000000000 Name2,340.000000000000,440.000000000000,550.000000000000,660.000000000000,770.000000000000 Name3,5.000000000000,6.000000000000,6.000000000000,5.000000000000,6.000000000000
可能吗?非常感谢。