annotate tests/group_by.ur @ 1909:659d1f4e95bf

make dist: Use fewer wildcards The remaining ones only work by accident: http://www.gnu.org/software/automake/manual/html_node/Wildcards.html and they have some practical problems too (we don?t really want to distribute include/urweb/config.h or src/config.sml), but this is enough for now to pass ?make distcheck? as long as we don?t run it from a separate build directory. Signed-off-by: Anders Kaseorg <andersk@mit.edu> --- Makefile.am | 6 +++--- src/c/Makefile.am | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
author Anders Kaseorg <andersk@mit.edu>
date Fri, 22 Nov 2013 09:36:14 -0500
parents d1b679dbbc25
children
rev   line source
adamc@226 1 table t1 : {A : int, B : string, C : float}
adamc@226 2 table t2 : {A : float, D : int}
adamc@226 3
adamc@226 4 val q1 = (SELECT * FROM t1 GROUP BY t1.B)
adamc@226 5 val q2 = (SELECT * FROM t1, t2 GROUP BY t1.B, t2.D, t1.A)
adamc@227 6
adamc@227 7 val q3 = (SELECT * FROM t1 WHERE t1.A = 0 GROUP BY t1.B)
adamc@259 8 val q4 = (SELECT * FROM t1 WHERE t1.A = 0 GROUP BY t1.B HAVING t1.B <> 'Bad')
adamc@227 9
adamc@227 10 val q5 = (SELECT t1.A, t2.D FROM t1, t2 GROUP BY t2.D, t1.A)
adamc@228 11 val q6 = (SELECT t1.A, t2.D FROM t1, t2 WHERE t1.C = 0.0 GROUP BY t2.D, t1.A HAVING t1.A = t1.A AND t2.D = 17)
adamc@255 12
adamc@255 13
adamc@255 14 datatype list a = Nil | Cons of a * list a
adamc@255 15
adamc@255 16 val r1 : transaction (list {B : string}) =
adamc@259 17 query q4
adamc@255 18 (fn fs acc => return (Cons (fs.T1, acc)))
adamc@255 19 Nil
adamc@255 20
adamc@255 21 val r2 : transaction string =
adamc@255 22 ls <- r1;
adamc@255 23 return (case ls of
adamc@255 24 Nil => "Problem"
adamc@255 25 | Cons ({B = b, ...}, _) => b)
adamc@255 26
adamc@255 27 val main : unit -> transaction page = fn () =>
adamc@255 28 s <- r2;
adamc@255 29 return <html><body>
adamc@255 30 {cdata s}
adamc@255 31 </body></html>