comparison tests/where.ur @ 255:69d337f186eb

Monoized GROUP BY
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 15:04:10 -0400
parents 71bafe66dbe1
children 35ed669a253f
comparison
equal deleted inserted replaced
254:f8d9395575ec 255:69d337f186eb
7 val q4 = (SELECT * FROM t1 WHERE {True}) 7 val q4 = (SELECT * FROM t1 WHERE {True})
8 val q5 = (SELECT * FROM t1 WHERE {1} = {1}) 8 val q5 = (SELECT * FROM t1 WHERE {1} = {1})
9 val q6 = (SELECT * FROM t1 WHERE {"Hi"} < {"Bye"}) 9 val q6 = (SELECT * FROM t1 WHERE {"Hi"} < {"Bye"})
10 val q7 = (SELECT * FROM t1 WHERE {1} <> {1} AND NOT ({"Hi"} >= {"Bye"})) 10 val q7 = (SELECT * FROM t1 WHERE {1} <> {1} AND NOT ({"Hi"} >= {"Bye"}))
11 val q8 = (SELECT * FROM t1 WHERE t1.A = 1 OR t1.C < 3.0) 11 val q8 = (SELECT * FROM t1 WHERE t1.A = 1 OR t1.C < 3.0)
12
13 datatype list a = Nil | Cons of a * list a
14
15 val r1 : transaction (list {A : int, B : string, C : float}) =
16 query q8
17 (fn fs acc => return (Cons (fs.T1, acc)))
18 Nil
19
20 val r2 : transaction string =
21 ls <- r1;
22 return (case ls of
23 Nil => "Problem"
24 | Cons ({B = b, ...}, _) => b)
25
26 val main : unit -> transaction page = fn () =>
27 s <- r2;
28 return <html><body>
29 {cdata s}
30 </body></html>