Till Westmann | fd733ee | 2014-07-10 00:57:37 -0700 | [diff] [blame] | 1 | use dataverse TinySocial; |
2 | |||||
3 | for $user in dataset MugshotUsers | ||||
4 | for $message in dataset MugshotMessages | ||||
5 | where $message.author-id = $user.id | ||||
6 | group by $name := $user.name with $message | ||||
7 | let $avglen := avg(for $m in $message | ||||
8 | return string-length($m.message)) | ||||
9 | order by $avglen desc | ||||
10 | limit 10 | ||||
11 | return { | ||||
12 | "uname" : $name, | ||||
13 | "msg-length" : $avglen | ||||
14 | }; |