Project

Profile

Help

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

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

1
<result>
2
 {
3
    for $highbid in doc("bids.xml")//bid_tuple,
4
        $user in doc("users.xml")//user_tuple
5
    where $user/userid = $highbid/userid 
6
      and $highbid/bid = max(for $z in doc("bids.xml")//bid_tuple[itemno=$highbid/itemno]/bid
7
                             return number($z))
8
    order by $highbid/itemno
9
    return
10
        <high_bid>
11
            { $highbid/itemno }
12
            { $highbid/bid }
13
            <bidder>{ $user/name/text() }</bidder>
14
        </high_bid>
15
  }
16
</result>
(7-7/42)