Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XBasic 0.46 KB | None | 0 0
  1. (: 7. Who have starred in the most distinct types of genre? :)
  2.  
  3. let $doc := result
  4. let $actorMovies := (
  5.   for $actor in $doc/actors/actor
  6.   return <a> {$actor, <movies> {
  7.     count(distinct-values(
  8.     for $videos in $doc/videos/video
  9.     where some $i in $videos/actorRef satisfies data($i) = $actor/@id
  10.     return $videos/genre
  11.     ))
  12.   } </movies>
  13. } </a>
  14. )
  15.  
  16. for $count in $actorMovies
  17. where max($actorMovies/movies) = $count/movies
  18. return $count/actor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement