adam@1776: table empsalary : { Depname : string,
adam@1778: Empno : int,
adam@1778: Salary : int }
adam@1776:
adam@1776: fun main () : transaction page =
adam@1777: x <- queryX (SELECT empsalary.Depname, empsalary.Empno, empsalary.Salary,
adam@1777: RANK() OVER (PARTITION BY empsalary.Depname ORDER BY empsalary.Salary DESC) AS R,
adam@1777: AVG(empsalary.Salary) OVER (PARTITION BY empsalary.Depname) AS A
adam@1776: FROM empsalary)
adam@1777: (fn r => {[r.Empsalary.Depname]}, {[r.Empsalary.Empno]}, {[r.Empsalary.Salary]}, {[r.R]}, {[r.A]}
);
adam@1776: return
adam@1776: {x}
adam@1776: