我正在使用XQuery来执行添加.以下是保存在数据库中的XML结构:
<Events>
<Event>
<id>1</id>
<code>1001</code>
<Amount>50,1</Amount>
</Event>
<Event>
<id>1</id>
<code>1002</code>
<Amount>5,5</Amount>
</Event>
<Event>
<id>1</id>
<code>1001</code>
<Amount>50,1</Amount>
</Event>
<Event>
<id>1</id>
<code>1002</code>
<Amount>5,5</Amount>
</Event>
</Events>
Run Code Online (Sandbox Code Playgroud)
我想通过使用XQuery获得低于输出:具有相同代码的金额之和.请注意,是..我需要更换,由.和执行运算.
<Total>
<1001> 100,2 </1001>
<1002> 11,0 </1002>
</Total>
Run Code Online (Sandbox Code Playgroud)