vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | // count, sum, avg |
2 | for $o in recordset(['oid', 'int32', 'date', 'int32', 'cid', 'int32', 'total', 'float'], 'osfiles', ['nc1', 'data/spj01/ord1.adm'], ['nc2', 'data/spj01/ord2.adm']) | ||||
3 | group by $cid := $o.cid with $o | ||||
4 | return { "cid": $cid , "ordpercust": count($o), | ||||
5 | "totalcust": sum(for $i in $o return $i.total), | ||||
6 | "avgcust": avg(for $i in $o return $i.total) } | ||||
7 |