annotate tests/agg.ur @ 1904:686fa4e7f397

xml/parse: Accept entity files on the command line Signed-off-by: Anders Kaseorg <andersk@mit.edu> --- Makefile.am | 2 +- xml/parse.sml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-)
author Anders Kaseorg <andersk@mit.edu>
date Fri, 22 Nov 2013 09:36:14 -0500
parents 601a77af0477
children
rev   line source
adamc@235 1 table t1 : {A : int, B : string, C : float}
adamc@1187 2 table t2 : {A : float, D : int, E : option string}
adamc@235 3
adamc@1194 4 val q1 : sql_query [] _ _ = (SELECT COUNT( * ) FROM t1)
adamc@1194 5 val q2 : sql_query [] _ _ = (SELECT AVG(t1.A) FROM t1)
adamc@1194 6 val q3 : sql_query [] _ _ = (SELECT SUM(t1.C) FROM t1)
adamc@1194 7 val q4 : sql_query [] _ _ = (SELECT MIN(t1.B), MAX(t1.A) FROM t1)
adamc@1194 8 val q5 : sql_query [] _ _ = (SELECT SUM(t1.A) FROM t1 GROUP BY t1.B)
adamc@1194 9 val q6 = (SELECT COUNT(t2.E) FROM t2 GROUP BY t2.D)
adamc@237 10
adamc@1187 11 fun main () : transaction page =
adamc@1194 12 xml <- queryX q6 (fn r => <xml>{[r.1]};</xml>);
adamc@1194 13 xml2 <- queryX q4 (fn r => <xml>{[r.1]}, {[r.2]};</xml>);
adamc@1194 14 return <xml><body>{xml}<br/>{xml2}</body></xml>