Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (: 7. Who have starred in the most distinct types of genre? :)
- let $doc := result
- let $actorMovies := (
- for $actor in $doc/actors/actor
- return <a> {$actor, <movies> {
- count(distinct-values(
- for $videos in $doc/videos/video
- where some $i in $videos/actorRef satisfies data($i) = $actor/@id
- return $videos/genre
- ))
- } </movies>
- } </a>
- )
- for $count in $actorMovies
- where max($actorMovies/movies) = $count/movies
- return $count/actor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement