view tests/window.ur @ 1993:3d1d44111906

Change Basis.getenv to return None outside the context of a web request
author Adam Chlipala <adam@chlipala.net>
date Tue, 04 Mar 2014 08:46:33 -0500
parents 818d4097e2ed
children
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() OVER (PARTITION BY empsalary.Depname ORDER BY empsalary.Salary DESC) AS R,
                   AVG(empsalary.Salary) OVER (PARTITION BY empsalary.Depname) AS A
                 FROM empsalary)
                (fn r => <xml>{[r.Empsalary.Depname]}, {[r.Empsalary.Empno]}, {[r.Empsalary.Salary]}, {[r.R]}, {[r.A]}<br/></xml>);
    return <xml><body>
      {x}
    </body></xml>