view tests/window.ur @ 1776:8f28c3295148

Compiled a window function use
author Adam Chlipala <adam@chlipala.net>
date Sat, 02 Jun 2012 16:00:50 -0400
parents
children 59b07fdae1ff
line wrap: on
line source
table empsalary : { Depname : string,
                   Empno : int,
                   Salary : int }

fun main () : transaction page =
    x <- queryX (SELECT empsalary.Depname, empsalary.Empno, empsalary.Salary, RANK() AS R
                 FROM empsalary)
                (fn r => <xml>{[r.Empsalary.Depname]}, {[r.Empsalary.Empno]}, {[r.Empsalary.Salary]}, {[r.R]}<br/></xml>);
    return <xml><body>
      {x}
    </body></xml>