Mercurial > urweb
view tests/agg.ur @ 835:b0a85cbefed2
Less whining about match failures; fix singleton record Jscomp bug
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 02 Jun 2009 12:40:09 -0400 |
parents | 7a7efbb3e354 |
children | ad9829c3c12c |
line wrap: on
line source
table t1 : {A : int, B : string, C : float} table t2 : {A : float, D : int} val q1 = (SELECT COUNT( * ) AS X FROM t1) val q2 = (SELECT AVG(t1.A) AS X FROM t1) val q3 = (SELECT SUM(t1.C) AS X FROM t1) val q4 = (SELECT MIN(t1.B) AS X, MAX(t1.A) AS Y FROM t1) (*val q5 = (SELECT t1.A FROM t1 GROUP BY t1.B)*) val q5 = (SELECT SUM(t1.A) AS X FROM t1 GROUP BY t1.B) datatype list a = Nil | Cons of a * list a val r1 : transaction (list string) = query q4 (fn fs acc => return (Cons (fs.X, acc))) Nil val main : unit -> transaction page = fn () => n <- r1; return <html><body>Nothing to see here!</body></html>