comparison tests/order_by.ur @ 261:ee51e9d35c9b

Monoize ORDER BY
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 16:03:43 -0400
parents 71bafe66dbe1
children bacd0ba869e1
comparison
equal deleted inserted replaced
260:645d0e8da643 261:ee51e9d35c9b
8 ORDER BY t1.B) 8 ORDER BY t1.B)
9 9
10 val q4 = (SELECT t1.A, t2.D, t1.A < t2.D AS Lt 10 val q4 = (SELECT t1.A, t2.D, t1.A < t2.D AS Lt
11 FROM t1, t2 11 FROM t1, t2
12 ORDER BY Lt) 12 ORDER BY Lt)
13 val q5 = (SELECT t1.A, t2.D, t1.A < t2.D AS Lt 13 val q5 = (SELECT t1.A, t1.B, t2.D, t1.A < t2.D AS Lt
14 FROM t1, t2 14 FROM t1, t2
15 ORDER BY t1.A, Lt, t2.D) 15 ORDER BY t1.A, Lt, t2.D)
16
17
18 datatype list a = Nil | Cons of a * list a
19
20 val r1 : transaction (list string) =
21 query q5
22 (fn fs acc => return (Cons (fs.T1.B, acc)))
23 Nil
24
25 val r2 : transaction string =
26 ls <- r1;
27 return (case ls of
28 Nil => "Problem"
29 | Cons (b, _) => b)
30
31 val main : unit -> transaction page = fn () =>
32 s <- r2;
33 return <html><body>
34 {cdata s}
35 </body></html>