Mercurial > urweb
view tests/subquery.ur @ 1907:cb57ba73a61d
make uninstall: Uninstall types_cpp.h, urweb_cpp.h
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Fri, 22 Nov 2013 09:36:14 -0500 |
parents | 9c82548c97e9 |
children |
line wrap: on
line source
table t : { A : int, B : int, C : int } fun main () = v <- queryX1 (SELECT t.A, t.C FROM t WHERE t.B = (SELECT MAX(U.B) AS M FROM t AS U WHERE U.A = t.A)) (fn r => <xml>{[r.A]},{[r.C]};</xml>); v' <- queryX1 (SELECT t.A, t.C FROM (SELECT t.A AS A, MAX(t.B) AS B FROM t GROUP BY t.A) AS Maxes JOIN t ON t.A = Maxes.A AND t.B = Maxes.B) (fn r => <xml>{[r.A]},{[r.C]};</xml>); return <xml><body> {v}<br/> {v'} </body></xml>