How do I write an XPath sum over 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 sum of (quantity * itemprice)
I can do this:
select *
from mytable
where documentdata.exist('/Order[sum(/Details/Detail/Quantity) > 20]) = 1
But I want to use Quantity * ItemPrice but I cant figure out the syntax for it..