aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/window1.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/window1.test b/test/window1.test
index a159fdaeb..93db98a72 100644
--- a/test/window1.test
+++ b/test/window1.test
@@ -195,5 +195,24 @@ do_execsql_test 5.4 {
SELECT ntile(1) OVER (ORDER BY a) FROM t4;
} {}
+#-------------------------------------------------------------------------
+reset_db
+do_execsql_test 6.1 {
+ CREATE TABLE t1(x);
+ INSERT INTO t1 VALUES(7), (6), (5), (4), (3), (2), (1);
+
+ CREATE TABLE t2(x);
+ INSERT INTO t2 VALUES('b'), ('a');
+
+ SELECT x, count(*) OVER (ORDER BY x) FROM t1;
+} {1 1 2 2 3 3 4 4 5 5 6 6 7 7}
+
+do_execsql_test 6.2 {
+ SELECT * FROM t2, (SELECT x, count(*) OVER (ORDER BY x) FROM t1);
+} {
+ b 1 1 b 2 2 b 3 3 b 4 4 b 5 5 b 6 6 b 7 7
+ a 1 1 a 2 2 a 3 3 a 4 4 a 5 5 a 6 6 a 7 7
+}
+
finish_test