diff tests/random.ur @ 1682:ac141fbb313a

'ORDER BY RANDOM' (based on a patch from Ron de Bruijn)
author Adam Chlipala <adam@chlipala.net>
date Thu, 02 Feb 2012 11:40:10 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/random.ur	Thu Feb 02 11:40:10 2012 -0500
@@ -0,0 +1,8 @@
+table t : { A : int }
+
+fun main () : transaction page =
+    x <- queryX (SELECT *
+                 FROM t
+                 ORDER BY RANDOM)
+         (fn r => <xml>{[r.T.A]}<br/></xml>);
+    return <xml><body>{x}</body></xml>