Query with distinct

For each author in the bibliography, list the author's name and the titles of all books by that author, grouped inside a result element.

   FOR $a IN distinct(document("bib.xml")//author)
     { $a }
     {  FOR $b IN document("bib.xml")/bib/book[author=$a]
        RETURN $b/title

Adapted from XML Query Use Cases

Previous | Next | Top | Cafe con Leche

Copyright 2000, 2001 Elliotte Rusty Harold
Last Modified September 13, 2001