Project

Profile

Help

How to connect?
Download (422 Bytes) Statistics
| Branch: | Tag: | Revision:

he / src / use-cases / r / q13.xq @ a31dd97a

1
<result>
2
 {
3
    for $uid in distinct-values(doc("bids.xml")//userid),
4
        $u in doc("users.xml")//user_tuple[userid = $uid]
5
    let $b := doc("bids.xml")//bid_tuple[userid = $uid]
6
    order by $u/userid
7
    return
8
        <bidder>
9
            { $u/userid }
10
            { $u/name }
11
            <bidcount>{ count($b) }</bidcount>
12
            <avgbid>{ avg($b/bid) }</avgbid>
13
        </bidder>
14
  }
15
</result>
(14-14/42)