Last active
June 12, 2020 21:46
-
-
Save emchateau/938ea6d51acd4686b6f7c39560387c1d to your computer and use it in GitHub Desktop.
pairs combinations in a sequence with XQuery
This file contains hidden or 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
xquery version "3.1" ; | |
(:~ | |
: Pairs combinations in a sequence | |
: Unique pairs in a sequence (where order is irrelevant) | |
:) | |
let $seq := ("a", "b", "b", "d") | |
for $i at $pos in $seq | |
for $j in fn:subsequence($seq, $pos+1, fn:count($seq)) | |
return <result>{$i, $j}</result> |
Author
emchateau
commented
Jun 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment