How to write XPath sum by the following structure?
<Order>
<Details>
<Detail>
<Quantity>10</Quantity>
<ItemPrice>20</Quantity>
</Detail>
<Detail>
<Quantity>10</Quantity>
<ItemPrice>20</Quantity>
</Detail>
</Details>
</Order>
I want to get the amount (quantity * itemprice)
I can do it:
select *
from mytable
where documentdata.exist('/Order[sum(/Details/Detail/Quantity) > 20]) = 1
But I want to use Item * Item Item, but I can not determine the syntax for it.
source
share