summaryrefslogtreecommitdiff
path: root/tests/ascdesc.ur
blob: 59dd0169abf9bbccb18bf5c1cc55efec768d9a71 (plain)
1
2
3
4
5
6
7
8
9
10
table t : { A : int }

fun sortEm b =
    queryX1 (SELECT * FROM t ORDER BY t.A {if b then sql_asc else sql_desc})
    (fn r => <xml>{[r.A]}; </xml>)

fun main () : transaction page = return <xml><body>
  <a link={sortEm True}>Ascending</a><br/>
  <a link={sortEm False}>Descending</a>
</body></xml>