Last active
March 18, 2024 17:33
-
-
Save dizzzz/a77f04f2fbf5e3422d4e05384ae8d9ef to your computer and use it in GitHub Desktop.
xquery find duplicates in sequence
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
(: wolfgang :) | |
for $i in (1, 5, 2, 4, 5) | |
group by $j := $i | |
return | |
$j || ": " || count($i) | |
(: adam :) | |
let $seq := (1, 5, 2, 4, 5) | |
return | |
distinct-values( | |
for $s in $seq | |
where count($seq[. eq $s]) gt 1 | |
return $s | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment