[xquery-talk] group by queries - a more efficient approach
jhunter at servlets.com
Thu Jul 31 21:58:53 PDT 2003
> for $s in distinct-values($this/mydata/book/subject)
> for $book in $this/mydata/book[subject/text() = $s/text()]
I suspect something like this would work. I haven't run it or anything.
Basically you can remove the /text() node tests and can return the
book nodes directly without needing a FLWOR.
for $s in distinct-values($this/mydata/book/subject)
$this/mydata/book[subject = $s]
More information about the talk