view 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 source
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>