Project

Profile

Help

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

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

1
<result>
2
  {
3
    let $end_dates := doc("items.xml")//item_tuple/end_date
4
    for $m in distinct-values(for $e in $end_dates 
5
                              return month-from-date($e))
6
    let $item := doc("items.xml")
7
        //item_tuple[year-from-date(end_date) = 1999 
8
                     and month-from-date(end_date) = $m]
9
    order by $m
10
    return
11
        <monthly_result>
12
            <month>{ $m }</month>
13
            <item_count>{ count($item) }</item_count>
14
        </monthly_result>
15
  }
16
</result>
(41-41/42)