annotate tests/window.ur @ 1991:7db8356caef5
Tweaked parameter renaming for functors, so now demos and the original bug-triggering application work
author |
Adam Chlipala <adam@chlipala.net> |
date |
Thu, 20 Feb 2014 15:50:33 -0500 |
parents |
818d4097e2ed |
children |
|
rev |
line source |
adam@1776
|
1 table empsalary : { Depname : string,
|
adam@1778
|
2 Empno : int,
|
adam@1778
|
3 Salary : int }
|
adam@1776
|
4
|
adam@1776
|
5 fun main () : transaction page =
|
adam@1777
|
6 x <- queryX (SELECT empsalary.Depname, empsalary.Empno, empsalary.Salary,
|
adam@1777
|
7 RANK() OVER (PARTITION BY empsalary.Depname ORDER BY empsalary.Salary DESC) AS R,
|
adam@1777
|
8 AVG(empsalary.Salary) OVER (PARTITION BY empsalary.Depname) AS A
|
adam@1776
|
9 FROM empsalary)
|
adam@1777
|
10 (fn r => <xml>{[r.Empsalary.Depname]}, {[r.Empsalary.Empno]}, {[r.Empsalary.Salary]}, {[r.R]}, {[r.A]}<br/></xml>);
|
adam@1776
|
11 return <xml><body>
|
adam@1776
|
12 {x}
|
adam@1776
|
13 </body></xml>
|