Mercurial > urweb
annotate tests/subquery.ur @ 1191:61c3139eab12
Subquery expressions
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 25 Mar 2010 15:44:24 -0400 |
parents | |
children | 9c82548c97e9 |
rev | line source |
---|---|
adamc@1191 | 1 table t : { A : int, B : int, C : int } |
adamc@1191 | 2 |
adamc@1191 | 3 fun main () = |
adamc@1191 | 4 v <- queryX1 (SELECT t.A, t.C |
adamc@1191 | 5 FROM t |
adamc@1191 | 6 WHERE t.B = (SELECT MAX(U.B) AS M |
adamc@1191 | 7 FROM t AS U |
adamc@1191 | 8 WHERE U.A = t.A)) |
adamc@1191 | 9 (fn r => <xml>{[r.A]},{[r.C]};</xml>); |
adamc@1191 | 10 return <xml>{v}</xml> |