Mercurial > urweb
annotate tests/agg.lac @ 241:052126db06e7
Shorthand for multi-binding exp 'fn'
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 28 Aug 2008 13:57:12 -0400 |
parents | 9182068c9d7c |
children |
rev | line source |
---|---|
adamc@235 | 1 table t1 : {A : int, B : string, C : float} |
adamc@235 | 2 table t2 : {A : float, D : int} |
adamc@235 | 3 |
adamc@236 | 4 val q1 = (SELECT COUNT( * ) AS X FROM t1) |
adamc@236 | 5 val q2 = (SELECT AVG(t1.A) AS X FROM t1) |
adamc@236 | 6 val q3 = (SELECT SUM(t1.C) AS X FROM t1) |
adamc@236 | 7 val q4 = (SELECT MIN(t1.B) AS X, MAX(t1.A) AS Y FROM t1) |
adamc@237 | 8 |
adamc@237 | 9 (*val q5 = (SELECT t1.A FROM t1 GROUP BY t1.B)*) |
adamc@237 | 10 val q5 = (SELECT SUM(t1.A) AS X FROM t1 GROUP BY t1.B) |