[xquery-talk] XQuery Feature: Grouping
martin at x-hive.com
Mon Feb 27 17:15:15 PST 2006
> Can you be more specific about what you think this grouping operator
> should do? I've been in a lot of discussions on grouping, and people
> have quite different expectations of what a grouping expression should
> do in an XML query language - obviously, SQL grouping does not fit this
> data model very well.
Grouping of nodes based on equality of some property of them, e.g.
Group so that I have a link from <author/>s to <book/>s.
I know this is currently achievable using the distinct-values function
(for $author in d-v(book/author) return book[author = $author]), but
this is not very obvious for users, hard to detect for databases, plus
it atomises the <author/> node. I remember XQuery was once advertised as
making it a lot easier to do such "turning XML inside-out" stuff - I
don't really consider this to be that easy ...
More information about the talk