-
-
Save emchateau/e08badae9c28861fabb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<sales-qty-by-product>{ | |
for $pname in distinct-values( | |
doc("sales-records.xml")/*/record/product-name) | |
order by $pname | |
return | |
<product name="{$pname}">{ | |
sum( | |
doc("sales-records.xml")/*/record[ | |
product-name eq $pname ]/qty) | |
}</product> | |
}</sales-qty-by-product> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment