From 1e7cb19be3f06951fcbafdb6055df04a4ca7924d Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 16 Mar 2019 20:29:54 +0000 Subject: [PATCH] Fix problems with RANGE windows and string, blob and NULL values. FossilOrigin-Name: cebe09e11cc91d9776f259dd9b87e9c760a460f53ba6fa36481dfe58f77ad417 --- manifest | 22 +- manifest.uuid | 2 +- src/parse.y | 2 +- src/window.c | 33 +- test/pg_common.tcl | 17 +- test/window1.test | 77 ++ test/window8.tcl | 22 + test/window8.test | 2195 +++++++++++++++++++++++++++++++++++++++++--- 8 files changed, 2205 insertions(+), 165 deletions(-) diff --git a/manifest b/manifest index 9fa2e248ad..baeaa3c8ea 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sorder\sto\sidentify\sthe\sfirst\srow\sof\seach\spartition,\scheck\sif\sthe\srowid\sin\sthe\sephemeral\stable\sis\s1\sinstead\sof\susing\sa\sdedicated\sflag\sregister. -D 2019-03-16T10:15:24.575 +C Fix\sproblems\swith\sRANGE\swindows\sand\sstring,\sblob\sand\sNULL\svalues. +D 2019-03-16T20:29:54.997 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F Makefile.in 236d2739dc3e823c3c909bca2d6cef93009bafbefd7018a8f3281074ecb92954 @@ -504,7 +504,7 @@ F src/os_win.c 85d9e532d0444ab6c16d7431490c2e279e282aa0917b0e988996b1ae0de5c5a0 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c 422fd8cfa59fb9173eff36a95878904a0eeb0dcc62ba49350acc8b1e51c4dc7b F src/pager.h 217921e81eb5fe455caa5cda96061959706bcdd29ddb57166198645ef7822ac3 -F src/parse.y a2a79da71f0c7c650a7ad84e0586c323441722b1af00ee19ae7dae91e5ae0432 +F src/parse.y cff56367d4226fe067eb595151352658af63e6bf55da84e71d3a72c36f3a0b00 F src/pcache.c 696a01f1a6370c1b50a09c15972bc3bee3333f8fcd1f2da8e9a76b1b062c59ee F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586 F src/pcache1.c a72804486dfa8e4b6bc30d666c97ecf1155f91a4351fc6e48ea4097e4eb304fb @@ -604,7 +604,7 @@ F src/where.c 8a207cb2ca6b99e1edb1e4bbff9b0504385a759cbf66180d1deb34d80ca4b799 F src/whereInt.h 5f14db426ca46a83eabab1ae9aa6d4b8f27504ad35b64c290916289b1ddb2e88 F src/wherecode.c ce7b21e1be2b981d62683fc59c4ca73a04a7ff2f1ebec23d41baf2da2349afd6 F src/whereexpr.c 90859652920f153d2c03f075488744be2926625ebd36911bcbcb17d0d29c891c -F src/window.c 58c0e510d1556e7b6176873afc66df29442a9e99937e5a05a5d3737191f72b98 +F src/window.c 3c13b17c47f85ccc2051c123345c7056c168a5ab1e6d237e8d1c59fb4f085470 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd F test/affinity3.test 6a101af2fc945ce2912f6fe54dd646018551710d @@ -1197,7 +1197,7 @@ F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff F test/permutations.test 52d2c37fe8cc07ec7362024c214b04bb69432995b3a984a3fbabc60fa6ada3ee -F test/pg_common.tcl 74f0f59f8eb87450f2b0284ae8c1155699f07f2f3af690f4069137b30c21a009 +F test/pg_common.tcl 85fac868078d6d71357642910663aaf95f2cf90b78c9817bcee311fe107f0608 F test/pragma.test c267bf02742c823a191960895b3d52933cebd7beee26757d1ed694f213fcd867 F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f F test/pragma3.test 8300aa9c63cff1027006ca34bf413a148abbd6dcd471fa9a1ded322fe18c0df9 @@ -1676,7 +1676,7 @@ F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2 F test/win32lock.test fbf107c91d8f5512be5a5b87c4c42ab9fdd54972 F test/win32longpath.test 169c75a3b2e43481f4a62122510210c67b08f26d F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc -F test/window1.test d690a34fc6b4e5032eed5eff659a1352d4a858352daeff1596e28910bae48727 +F test/window1.test 6c7bbed965407a28fc699d3bab2fd199e75dbd7a5b3fe88dfe8149c583a526eb F test/window2.tcl 9bfa842d8a62b0d36dc8c1b5972206393c43847433c6d75940b87fec93ce3143 F test/window2.test 8e6d2a1b9f54dfebee1cde961c8590cd87b4db45c50f44947a211e1b63c2a05e F test/window3.tcl acea6e86a4324a210fd608d06741010ca83ded9fde438341cb978c49928faf03 @@ -1687,8 +1687,8 @@ F test/window5.test d328dd18221217c49c144181975eea17339eaeaf0e9aa558cee3afb84652 F test/window6.test 604890f2b0f976339e6a1774cd90d48840e57a54b4f21a8b4b3047aa2c9787d1 F test/window7.tcl 6a1210f05d40ec89c22960213a22cd3f98d4e2f2eb20646c83c8c30d4d76108f F test/window7.test ce7f865241fdd1c5c4db869cd7bb2986c3be836bc2e73649a6846dd920f63e0f -F test/window8.tcl e4b794bdc0e30302d393a1af7593363a4525629a9a1d3a9b6e96f24590d36992 -F test/window8.test 1b8de9067bea0e7857d152ced7ef76716bc2c9f1271755016345ab16a56549e3 +F test/window8.tcl 3f973e4007cade9e1700434220505bf1ada7f0f13edb1803322cb78069bda7d7 +F test/window8.test 118243072b074d76400b4f528322a2d79a36e02e114da95ebba6610785cd10f2 F test/windowerr.tcl 4f0b111cdbb8de401a8135cd116604fb8add13042bb47a1f1496dd47a690e864 F test/windowerr.test 461bc504d4af0ae16a081e0c3bdb3724356cdcfb07bdc4b1b2dc4ad91b69bb7e F test/windowfault.test 12ceb6bbb355d13e8fcd88c5731a57256dfdf77b9a7ae20842a76fcd4623df5b @@ -1812,7 +1812,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9b43c3ee2e054b05715573f4f3893b84aabc5100832333c9a0f2a1628552a978 -R 7c14a1c696a17b72f9ba56dd7fcded6e +P f2d5f7a24c7aa483c579706c5bd7268a74da6d53025d78fa8642908c2aed1707 +R 1f818016fedca9daa5b8ba9c8e0b3de6 U dan -Z 0c21ffc0cb9db6cb2728e05b5fb3d423 +Z 3e69c8f976def5bbb22a7214f3463083 diff --git a/manifest.uuid b/manifest.uuid index 220e1fb570..7e704679d7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f2d5f7a24c7aa483c579706c5bd7268a74da6d53025d78fa8642908c2aed1707 \ No newline at end of file +cebe09e11cc91d9776f259dd9b87e9c760a460f53ba6fa36481dfe58f77ad417 \ No newline at end of file diff --git a/src/parse.y b/src/parse.y index dcbc313197..547442293a 100644 --- a/src/parse.y +++ b/src/parse.y @@ -1712,7 +1712,7 @@ frame_bound(A) ::= CURRENT ROW. { A.eType = TK_CURRENT ; A.pExpr = 0; } frame_bound(A) ::= expr(X) FOLLOWING. { A.eType = TK_FOLLOWING; A.pExpr = X; } %type frame_exclude_opt {u8} -frame_exclude_opt(A) ::= . { A = TK_NO; } +frame_exclude_opt(A) ::= . { A = 0; } frame_exclude_opt(A) ::= EXCLUDE frame_exclude(X). { A = X; } %type frame_exclude {u8} diff --git a/src/window.c b/src/window.c index c05e5b10f1..d3088c0c83 100644 --- a/src/window.c +++ b/src/window.c @@ -1076,7 +1076,6 @@ Window *sqlite3WindowAlloc( pWin->bImplicitFrame = bImplicitFrame; pWin->pEnd = sqlite3WindowOffsetExpr(pParse, pEnd); pWin->pStart = sqlite3WindowOffsetExpr(pParse, pStart); - /* pWin->eExclude = 1; */ return pWin; windowAllocErr: @@ -1742,11 +1741,14 @@ static void windowIfNewPeer( /* ** This function is called as part of generating VM programs for RANGE -** offset PRECEDING/FOLLOWING frame boundaries. It generates code equivalent -** to: +** offset PRECEDING/FOLLOWING frame boundaries. Assuming "ASC" order for +** the ORDER BY term in the window, it generates code equivalent to: ** ** if( csr1.peerVal + regVal >= csr2.peerVal ) goto lbl; -** if( csr1.rowid >= csr2.rowid ) goto lbl; +** +** A special type of arithmetic is used such that if csr.peerVal is not +** a numeric type (real or integer), then the result of the addition is +** a copy of csr1.peerVal. */ static void windowCodeRangeTest( WindowCodeArg *p, @@ -1761,6 +1763,10 @@ static void windowCodeRangeTest( int reg1 = sqlite3GetTempReg(pParse); int reg2 = sqlite3GetTempReg(pParse); int arith = OP_Add; + int addrGe; + int addrNotNull; + + int regString = ++pParse->nMem; assert( op==OP_Ge || op==OP_Gt || op==OP_Le ); assert( p->pMWin->pOrderBy && p->pMWin->pOrderBy->nExpr==1 ); @@ -1775,11 +1781,24 @@ static void windowCodeRangeTest( windowReadPeerValues(p, csr1, reg1); windowReadPeerValues(p, csr2, reg2); + + /* Check if the peer value for csr1 value is a text or blob by comparing + ** it to the smallest possible string - ''. */ + sqlite3VdbeAddOp4(v, OP_String8, 0, regString, 0, "", P4_STATIC); + addrGe = sqlite3VdbeAddOp3(v, OP_Ge, regString, 0, reg1); + + if( op==OP_Le ){ + sqlite3VdbeAddOp2(v, OP_IsNull, reg1, lbl); + } + if( op==OP_Ge ){ + sqlite3VdbeAddOp2(v, OP_NotNull, reg1, sqlite3VdbeCurrentAddr(v)+2); + sqlite3VdbeAddOp2(v, OP_IsNull, reg2, lbl); + } + sqlite3VdbeAddOp3(v, arith, regVal, reg1, reg1); + sqlite3VdbeJumpHere(v, addrGe); sqlite3VdbeAddOp3(v, op, reg2, lbl, reg1); - sqlite3VdbeAddOp2(v, OP_Rowid, csr1, reg1); - sqlite3VdbeAddOp2(v, OP_Rowid, csr2, reg2); - sqlite3VdbeAddOp3(v, OP_Gt, reg2, lbl, reg1); + sqlite3ReleaseTempReg(pParse, reg1); sqlite3ReleaseTempReg(pParse, reg2); } diff --git a/test/pg_common.tcl b/test/pg_common.tcl index 902f8a36c1..80287c1161 100644 --- a/test/pg_common.tcl +++ b/test/pg_common.tcl @@ -40,17 +40,26 @@ proc execsql {sql} { #puts $lSql set ret "" + set nChar 0 foreach stmt $lSql { set res [pg_exec $::db $stmt] set err [pg_result $res -error] if {$err!=""} { error $err } + for {set i 0} {$i < [pg_result $res -numTuples]} {incr i} { - if {$i==0} { - set ret [pg_result $res -getTuple 0] + set t [pg_result $res -getTuple $i] + set nNew [string length $t] + if {$nChar>0 && ($nChar+$nNew+3)>75} { + append ret "\n " + set nChar 0 } else { - append ret " [pg_result $res -getTuple $i]" + if {$nChar>0} { + append ret " " + incr nChar 3 + } } - # lappend ret {*}[pg_result $res -getTuple $i] + incr nChar $nNew + append ret $t } pg_result $res -clear } diff --git a/test/window1.test b/test/window1.test index e7cfe05496..1a2d9dcb89 100644 --- a/test/window1.test +++ b/test/window1.test @@ -849,4 +849,81 @@ do_execsql_test 18.3.5 { win5 AS (win4 ORDER BY c) } {four four.six four.six.two five five.one five.one.three} +#------------------------------------------------------------------------- +# Test RANGE PRECEDING/FOLLOWING when there are string, blob +# and NULL values in the dataset. +# +reset_db +do_execsql_test 19.0 { + CREATE TABLE t1(a, b); + INSERT INTO t1 VALUES + (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), + ('a', 6), ('b', 7), ('c', 8), ('d', 9), ('e', 10); +} +do_execsql_test 19.1 { + SELECT a, sum(b) OVER (ORDER BY a) FROM t1; +} {1 1 2 3 3 6 4 10 5 15 a 21 b 28 c 36 d 45 e 55} + +do_execsql_test 19.2.1 { + SELECT a, sum(b) OVER ( + ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING + ) FROM t1; +} {1 3 2 6 3 9 4 12 5 9 a 6 b 7 c 8 d 9 e 10} +do_execsql_test 19.2.2 { + SELECT a, sum(b) OVER ( + ORDER BY a DESC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING + ) FROM t1 ORDER BY a ASC; +} {1 3 2 6 3 9 4 12 5 9 a 6 b 7 c 8 d 9 e 10} + +do_execsql_test 19.3.1 { + SELECT a, sum(b) OVER ( + ORDER BY a RANGE BETWEEN 2 PRECEDING AND 1 FOLLOWING + ) FROM t1; +} {1 3 2 6 3 10 4 14 5 12 a 6 b 7 c 8 d 9 e 10} +do_execsql_test 19.3.2 { + SELECT a, sum(b) OVER ( + ORDER BY a DESC RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING + ) FROM t1 ORDER BY a ASC; +} {1 3 2 6 3 10 4 14 5 12 a 6 b 7 c 8 d 9 e 10} + + +reset_db +do_execsql_test 20.0 { + CREATE TABLE t1(a, b); + INSERT INTO t1 VALUES + (NULL, 100), (NULL, 100), + (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), + ('a', 6), ('b', 7), ('c', 8), ('d', 9), ('e', 10); +} +do_execsql_test 20.1 { + SELECT a, sum(b) OVER (ORDER BY a) FROM t1; +} { + {} 200 {} 200 1 201 2 203 3 206 4 210 5 215 + a 221 b 228 c 236 d 245 e 255 +} + +do_execsql_test 20.2.1 { + SELECT a, sum(b) OVER ( + ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING + ) FROM t1; +} {{} 200 {} 200 1 3 2 6 3 9 4 12 5 9 a 6 b 7 c 8 d 9 e 10} +do_execsql_test 20.2.2 { + SELECT a, sum(b) OVER ( + ORDER BY a DESC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING + ) FROM t1 ORDER BY a ASC; +} {{} 200 {} 200 1 3 2 6 3 9 4 12 5 9 a 6 b 7 c 8 d 9 e 10} + +do_execsql_test 20.3.1 { + SELECT a, sum(b) OVER ( + ORDER BY a RANGE BETWEEN 2 PRECEDING AND 1 FOLLOWING + ) FROM t1; +} {{} 200 {} 200 1 3 2 6 3 10 4 14 5 12 a 6 b 7 c 8 d 9 e 10} +do_execsql_test 20.3.2 { + SELECT a, sum(b) OVER ( + ORDER BY a DESC RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING + ) FROM t1 ORDER BY a ASC; +} {{} 200 {} 200 1 3 2 6 3 10 4 14 5 12 a 6 b 7 c 8 d 9 e 10} + finish_test + + diff --git a/test/window8.tcl b/test/window8.tcl index 75d4d0193f..3cbeea2e8c 100644 --- a/test/window8.tcl +++ b/test/window8.tcl @@ -122,6 +122,14 @@ foreach {tn ex} { ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING $ex ) " + + execsql_test 2.$tn.3 " + SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3 + WINDOW win AS ( + ORDER BY c, b, a + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW $ex + ) ORDER BY a, b, c; + " } ========== @@ -154,6 +162,20 @@ foreach {tn frame} { " } +========== + +execsql_test 4.0 { + DROP TABLE IF EXISTS t1; + CREATE TABLE t1(a INTEGER, b INTEGER); + INSERT INTO t1 VALUES + (NULL, 1), (NULL, 2), (NULL, 3), (10, 4), (10, 5); +} + +execsql_test 4.1 { + SELECT sum(b) OVER ( + ORDER BY a RANGE BETWEEN 5 PRECEDING AND 10 FOLLOWING + ) FROM t1 ORDER BY 1; +} finish_test diff --git a/test/window8.test b/test/window8.test index 5b2eabd893..b1ccddcbf5 100644 --- a/test/window8.test +++ b/test/window8.test @@ -55,535 +55,2293 @@ do_execsql_test 1.0 { do_execsql_test 1.1.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147 DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 19179 EE aa 19179 EE bb 19179 EE bb 19179 EE bb 19179 FF aa 21718 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 GG aa 27386 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 27386 GG bb 27386 GG bb 27386 GG bb 27386 HH aa 31854 HH aa 31854 HH aa 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 II aa 37297 II aa 37297 II bb 37297 II bb 37297 II bb 37297 II bb 37297 II bb 37297 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ bb 40937 JJ bb 40937 JJ bb 40937 JJ bb 40937} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 + BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 + CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147 + DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 19179 + EE aa 19179 EE bb 19179 EE bb 19179 EE bb 19179 FF aa 21718 + FF aa 21718 FF aa 21718 FF aa 21718 FF bb 21718 FF bb 21718 + FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 GG aa 27386 + GG aa 27386 GG aa 27386 GG aa 27386 GG bb 27386 GG bb 27386 + GG bb 27386 GG bb 27386 HH aa 31854 HH aa 31854 HH aa 31854 + HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 + HH bb 31854 II aa 37297 II aa 37297 II bb 37297 II bb 37297 + II bb 37297 II bb 37297 II bb 37297 JJ aa 40937 JJ aa 40937 + JJ aa 40937 JJ aa 40937 JJ bb 40937 JJ bb 40937 JJ bb 40937 + JJ bb 40937} do_execsql_test 1.1.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 CC bb 13979 CC bb 13979 DD aa 15147 DD aa 15147 DD aa 15147 DD bb 16472 DD bb 16472 DD bb 16472 DD bb 16472 EE aa 19179 EE aa 19179 EE bb 20069 EE bb 20069 EE bb 20069 FF aa 21718 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 GG aa 27386 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 28983 GG bb 28983 GG bb 28983 GG bb 28983 HH aa 31854 HH aa 31854 HH aa 31854 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103 II aa 37297 II aa 37297 II bb 38347 II bb 38347 II bb 38347 II bb 38347 II bb 38347 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ bb 42951 JJ bb 42951 JJ bb 42951 JJ bb 42951} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 + AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 + BB bb 7558 BB bb 7558 CC aa 12025 CC aa 12025 CC aa 12025 + CC aa 12025 CC bb 13979 CC bb 13979 DD aa 15147 DD aa 15147 + DD aa 15147 DD bb 16472 DD bb 16472 DD bb 16472 DD bb 16472 + EE aa 19179 EE aa 19179 EE bb 20069 EE bb 20069 EE bb 20069 + FF aa 21718 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 23881 + FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 + GG aa 27386 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 28983 + GG bb 28983 GG bb 28983 GG bb 28983 HH aa 31854 HH aa 31854 + HH aa 31854 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103 + HH bb 34103 HH bb 34103 II aa 37297 II aa 37297 II bb 38347 + II bb 38347 II bb 38347 II bb 38347 II bb 38347 JJ aa 40937 + JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ bb 42951 JJ bb 42951 + JJ bb 42951 JJ bb 42951} do_execsql_test 1.1.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.1.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934 CC bb 934 CC bb 934 DD aa 934 DD aa 934 DD aa 934 DD bb 934 DD bb 934 DD bb 934 DD bb 934 EE aa 959 EE aa 959 EE bb 959 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 959 GG bb 959 GG bb 959 GG bb 959 HH aa 959 HH aa 959 HH aa 959 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979 JJ bb 979 JJ bb 979} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934 + AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 + BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 + BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934 + CC bb 934 CC bb 934 DD aa 934 DD aa 934 DD aa 934 DD bb 934 + DD bb 934 DD bb 934 DD bb 934 EE aa 959 EE aa 959 EE bb 959 + EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 + FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 + GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 959 GG bb 959 + GG bb 959 GG bb 959 HH aa 959 HH aa 959 HH aa 959 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 + JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979 + JJ bb 979 JJ bb 979} do_execsql_test 1.1.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 CC aa 223 CC aa 223 CC aa 223 CC aa 223 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 DD bb 158 DD bb 158 DD bb 158 EE aa 158 EE aa 158 EE bb 113 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102 II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102 JJ bb 102 JJ bb 102} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223 + AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 + BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 + BB bb 223 BB bb 223 CC aa 223 CC aa 223 CC aa 223 CC aa 223 + CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 + DD bb 158 DD bb 158 DD bb 158 EE aa 158 EE aa 158 EE bb 113 + EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 + FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102 + HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102 + II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102 + JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102 + JJ bb 102 JJ bb 102} do_execsql_test 1.1.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147 DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 19179 EE aa 19179 EE bb 19179 EE bb 19179 EE bb 19179 FF aa 21718 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 GG aa 27386 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 27386 GG bb 27386 GG bb 27386 GG bb 27386 HH aa 31854 HH aa 31854 HH aa 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 II aa 37297 II aa 37297 II bb 37297 II bb 37297 II bb 37297 II bb 37297 II bb 37297 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ bb 40937 JJ bb 40937 JJ bb 40937 JJ bb 40937} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 + BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 + CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147 + DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 19179 + EE aa 19179 EE bb 19179 EE bb 19179 EE bb 19179 FF aa 21718 + FF aa 21718 FF aa 21718 FF aa 21718 FF bb 21718 FF bb 21718 + FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 GG aa 27386 + GG aa 27386 GG aa 27386 GG aa 27386 GG bb 27386 GG bb 27386 + GG bb 27386 GG bb 27386 HH aa 31854 HH aa 31854 HH aa 31854 + HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 + HH bb 31854 II aa 37297 II aa 37297 II bb 37297 II bb 37297 + II bb 37297 II bb 37297 II bb 37297 JJ aa 40937 JJ aa 40937 + JJ aa 40937 JJ aa 40937 JJ bb 40937 JJ bb 40937 JJ bb 40937 + JJ bb 40937} do_execsql_test 1.1.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 CC bb 13979 CC bb 13979 DD aa 15147 DD aa 15147 DD aa 15147 DD bb 16472 DD bb 16472 DD bb 16472 DD bb 16472 EE aa 19179 EE aa 19179 EE bb 20069 EE bb 20069 EE bb 20069 FF aa 21718 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 GG aa 27386 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 28983 GG bb 28983 GG bb 28983 GG bb 28983 HH aa 31854 HH aa 31854 HH aa 31854 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103 II aa 37297 II aa 37297 II bb 38347 II bb 38347 II bb 38347 II bb 38347 II bb 38347 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ bb 42951 JJ bb 42951 JJ bb 42951 JJ bb 42951} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 + AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 + BB bb 7558 BB bb 7558 CC aa 12025 CC aa 12025 CC aa 12025 + CC aa 12025 CC bb 13979 CC bb 13979 DD aa 15147 DD aa 15147 + DD aa 15147 DD bb 16472 DD bb 16472 DD bb 16472 DD bb 16472 + EE aa 19179 EE aa 19179 EE bb 20069 EE bb 20069 EE bb 20069 + FF aa 21718 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 23881 + FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 + GG aa 27386 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 28983 + GG bb 28983 GG bb 28983 GG bb 28983 HH aa 31854 HH aa 31854 + HH aa 31854 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103 + HH bb 34103 HH bb 34103 II aa 37297 II aa 37297 II bb 38347 + II bb 38347 II bb 38347 II bb 38347 II bb 38347 JJ aa 40937 + JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ bb 42951 JJ bb 42951 + JJ bb 42951 JJ bb 42951} do_execsql_test 1.2.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147 DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179 DD bb 19179 DD bb 19179 EE aa 21718 EE aa 21718 EE bb 21718 EE bb 21718 EE bb 21718 FF aa 27386 FF aa 27386 FF aa 27386 FF aa 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 GG aa 31854 GG aa 31854 GG aa 31854 GG aa 31854 GG bb 31854 GG bb 31854 GG bb 31854 GG bb 31854 HH aa 37297 HH aa 37297 HH aa 37297 HH bb 37297 HH bb 37297 HH bb 37297 HH bb 37297 HH bb 37297 HH bb 37297 II aa 40937 II aa 40937 II bb 40937 II bb 40937 II bb 40937 II bb 40937 II bb 40937 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} +} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025 + BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025 + BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147 + CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147 + DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179 + DD bb 19179 DD bb 19179 EE aa 21718 EE aa 21718 EE bb 21718 + EE bb 21718 EE bb 21718 FF aa 27386 FF aa 27386 FF aa 27386 + FF aa 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 + FF bb 27386 FF bb 27386 GG aa 31854 GG aa 31854 GG aa 31854 + GG aa 31854 GG bb 31854 GG bb 31854 GG bb 31854 GG bb 31854 + HH aa 37297 HH aa 37297 HH aa 37297 HH bb 37297 HH bb 37297 + HH bb 37297 HH bb 37297 HH bb 37297 HH bb 37297 II aa 40937 + II aa 40937 II bb 40937 II bb 40937 II bb 40937 II bb 40937 + II bb 40937 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 + JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} do_execsql_test 1.2.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 13979 CC aa 13979 CC aa 13979 CC aa 13979 CC bb 15147 CC bb 15147 DD aa 16472 DD aa 16472 DD aa 16472 DD bb 19179 DD bb 19179 DD bb 19179 DD bb 19179 EE aa 20069 EE aa 20069 EE bb 21718 EE bb 21718 EE bb 21718 FF aa 23881 FF aa 23881 FF aa 23881 FF aa 23881 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 GG aa 28983 GG aa 28983 GG aa 28983 GG aa 28983 GG bb 31854 GG bb 31854 GG bb 31854 GG bb 31854 HH aa 34103 HH aa 34103 HH aa 34103 HH bb 37297 HH bb 37297 HH bb 37297 HH bb 37297 HH bb 37297 HH bb 37297 II aa 38347 II aa 38347 II bb 40937 II bb 40937 II bb 40937 II bb 40937 II bb 40937 JJ aa 42951 JJ aa 42951 JJ aa 42951 JJ aa 42951 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} +} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 + BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025 + BB bb 12025 BB bb 12025 BB bb 12025 CC aa 13979 CC aa 13979 + CC aa 13979 CC aa 13979 CC bb 15147 CC bb 15147 DD aa 16472 + DD aa 16472 DD aa 16472 DD bb 19179 DD bb 19179 DD bb 19179 + DD bb 19179 EE aa 20069 EE aa 20069 EE bb 21718 EE bb 21718 + EE bb 21718 FF aa 23881 FF aa 23881 FF aa 23881 FF aa 23881 + FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 + FF bb 27386 GG aa 28983 GG aa 28983 GG aa 28983 GG aa 28983 + GG bb 31854 GG bb 31854 GG bb 31854 GG bb 31854 HH aa 34103 + HH aa 34103 HH aa 34103 HH bb 37297 HH bb 37297 HH bb 37297 + HH bb 37297 HH bb 37297 HH bb 37297 II aa 38347 II aa 38347 + II bb 40937 II bb 40937 II bb 40937 II bb 40937 II bb 40937 + JJ aa 42951 JJ aa 42951 JJ aa 42951 JJ aa 42951 JJ bb 44737 + JJ bb 44737 JJ bb 44737 JJ bb 44737} do_execsql_test 1.2.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.2.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934 CC bb 934 CC bb 934 DD aa 934 DD aa 934 DD aa 934 DD bb 959 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 959 GG bb 959 GG bb 959 GG bb 959 HH aa 979 HH aa 979 HH aa 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979 JJ bb 979 JJ bb 979} +} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 + AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 + BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 + BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934 + CC bb 934 CC bb 934 DD aa 934 DD aa 934 DD aa 934 DD bb 959 + DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 + EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 + FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 + GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 959 GG bb 959 + GG bb 959 GG bb 959 HH aa 979 HH aa 979 HH aa 979 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 + JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979 + JJ bb 979 JJ bb 979} do_execsql_test 1.2.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102 II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102 JJ bb 102 JJ bb 102} +} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 + AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 + BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 + BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158 + CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 + DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113 + EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102 + HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102 + II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102 + JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102 + JJ bb 102 JJ bb 102} do_execsql_test 1.2.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801 DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385 DD bb 18463 DD bb 18941 EE aa 20941 EE aa 21605 EE bb 20950 EE bb 21089 EE bb 21466 FF aa 26716 FF aa 26719 FF aa 26768 FF aa 27178 FF bb 26448 FF bb 26516 FF bb 26660 FF bb 26812 FF bb 27091 FF bb 27284 GG aa 31220 GG aa 31374 GG aa 31519 GG aa 31706 GG bb 30916 GG bb 30925 GG bb 31010 GG bb 31694 HH aa 36318 HH aa 36507 HH aa 36817 HH bb 36334 HH bb 36567 HH bb 36614 HH bb 36942 HH bb 36967 HH bb 37164 II aa 40285 II aa 40539 II bb 40132 II bb 40266 II bb 40494 II bb 40516 II bb 40687 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} +} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613 + BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233 + BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388 + CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801 + DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385 + DD bb 18463 DD bb 18941 EE aa 20941 EE aa 21605 EE bb 20950 + EE bb 21089 EE bb 21466 FF aa 26716 FF aa 26719 FF aa 26768 + FF aa 27178 FF bb 26448 FF bb 26516 FF bb 26660 FF bb 26812 + FF bb 27091 FF bb 27284 GG aa 31220 GG aa 31374 GG aa 31519 + GG aa 31706 GG bb 30916 GG bb 30925 GG bb 31010 GG bb 31694 + HH aa 36318 HH aa 36507 HH aa 36817 HH bb 36334 HH bb 36567 + HH bb 36614 HH bb 36942 HH bb 36967 HH bb 37164 II aa 40285 + II aa 40539 II bb 40132 II bb 40266 II bb 40494 II bb 40516 + II bb 40687 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624 + JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} do_execsql_test 1.2.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159 BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 13220 CC aa 13372 CC aa 13549 CC aa 13821 CC bb 14325 CC bb 14801 DD aa 15627 DD aa 16216 DD aa 16248 DD bb 18220 DD bb 18385 DD bb 18463 DD bb 18941 EE aa 19292 EE aa 19956 EE bb 20950 EE bb 21089 EE bb 21466 FF aa 23211 FF aa 23214 FF aa 23263 FF aa 23673 FF bb 26448 FF bb 26516 FF bb 26660 FF bb 26812 FF bb 27091 FF bb 27284 GG aa 28349 GG aa 28503 GG aa 28648 GG aa 28835 GG bb 30916 GG bb 30925 GG bb 31010 GG bb 31694 HH aa 33124 HH aa 33313 HH aa 33623 HH bb 36334 HH bb 36567 HH bb 36614 HH bb 36942 HH bb 36967 HH bb 37164 II aa 37695 II aa 37949 II bb 40132 II bb 40266 II bb 40494 II bb 40516 II bb 40687 JJ aa 42052 JJ aa 42183 JJ aa 42717 JJ aa 42838 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} +} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159 + BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239 + BB bb 11314 BB bb 11320 BB bb 11392 CC aa 13220 CC aa 13372 + CC aa 13549 CC aa 13821 CC bb 14325 CC bb 14801 DD aa 15627 + DD aa 16216 DD aa 16248 DD bb 18220 DD bb 18385 DD bb 18463 + DD bb 18941 EE aa 19292 EE aa 19956 EE bb 20950 EE bb 21089 + EE bb 21466 FF aa 23211 FF aa 23214 FF aa 23263 FF aa 23673 + FF bb 26448 FF bb 26516 FF bb 26660 FF bb 26812 FF bb 27091 + FF bb 27284 GG aa 28349 GG aa 28503 GG aa 28648 GG aa 28835 + GG bb 30916 GG bb 30925 GG bb 31010 GG bb 31694 HH aa 33124 + HH aa 33313 HH aa 33623 HH bb 36334 HH bb 36567 HH bb 36614 + HH bb 36942 HH bb 36967 HH bb 37164 II aa 37695 II aa 37949 + II bb 40132 II bb 40266 II bb 40494 II bb 40516 II bb 40687 + JJ aa 42052 JJ aa 42183 JJ aa 42717 JJ aa 42838 JJ bb 43898 + JJ bb 44383 JJ bb 44401 JJ bb 44480} do_execsql_test 1.3.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 12025 AA aa 12025 AA aa 12025 AA aa 12025 AA bb 12025 AA bb 12025 AA bb 12025 AA bb 12025 BB aa 15147 BB aa 15147 BB aa 15147 BB aa 15147 BB aa 15147 BB aa 15147 BB bb 15147 BB bb 15147 BB bb 15147 BB bb 15147 BB bb 15147 BB bb 15147 CC aa 19179 CC aa 19179 CC aa 19179 CC aa 19179 CC bb 19179 CC bb 19179 DD aa 21718 DD aa 21718 DD aa 21718 DD bb 21718 DD bb 21718 DD bb 21718 DD bb 21718 EE aa 27386 EE aa 27386 EE bb 27386 EE bb 27386 EE bb 27386 FF aa 31854 FF aa 31854 FF aa 31854 FF aa 31854 FF bb 31854 FF bb 31854 FF bb 31854 FF bb 31854 FF bb 31854 FF bb 31854 GG aa 37297 GG aa 37297 GG aa 37297 GG aa 37297 GG bb 37297 GG bb 37297 GG bb 37297 GG bb 37297 HH aa 40937 HH aa 40937 HH aa 40937 HH bb 40937 HH bb 40937 HH bb 40937 HH bb 40937 HH bb 40937 HH bb 40937 II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737 II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} +} {AA aa 12025 AA aa 12025 AA aa 12025 AA aa 12025 AA bb 12025 + AA bb 12025 AA bb 12025 AA bb 12025 BB aa 15147 BB aa 15147 + BB aa 15147 BB aa 15147 BB aa 15147 BB aa 15147 BB bb 15147 + BB bb 15147 BB bb 15147 BB bb 15147 BB bb 15147 BB bb 15147 + CC aa 19179 CC aa 19179 CC aa 19179 CC aa 19179 CC bb 19179 + CC bb 19179 DD aa 21718 DD aa 21718 DD aa 21718 DD bb 21718 + DD bb 21718 DD bb 21718 DD bb 21718 EE aa 27386 EE aa 27386 + EE bb 27386 EE bb 27386 EE bb 27386 FF aa 31854 FF aa 31854 + FF aa 31854 FF aa 31854 FF bb 31854 FF bb 31854 FF bb 31854 + FF bb 31854 FF bb 31854 FF bb 31854 GG aa 37297 GG aa 37297 + GG aa 37297 GG aa 37297 GG bb 37297 GG bb 37297 GG bb 37297 + GG bb 37297 HH aa 40937 HH aa 40937 HH aa 40937 HH bb 40937 + HH bb 40937 HH bb 40937 HH bb 40937 HH bb 40937 HH bb 40937 + II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737 + II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 + JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} do_execsql_test 1.3.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 7558 AA bb 7558 AA bb 7558 AA bb 7558 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 13979 BB bb 13979 BB bb 13979 BB bb 13979 BB bb 13979 BB bb 13979 CC aa 15147 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 16472 CC bb 16472 DD aa 19179 DD aa 19179 DD aa 19179 DD bb 20069 DD bb 20069 DD bb 20069 DD bb 20069 EE aa 21718 EE aa 21718 EE bb 23881 EE bb 23881 EE bb 23881 FF aa 27386 FF aa 27386 FF aa 27386 FF aa 27386 FF bb 28983 FF bb 28983 FF bb 28983 FF bb 28983 FF bb 28983 FF bb 28983 GG aa 31854 GG aa 31854 GG aa 31854 GG aa 31854 GG bb 34103 GG bb 34103 GG bb 34103 GG bb 34103 HH aa 37297 HH aa 37297 HH aa 37297 HH bb 38347 HH bb 38347 HH bb 38347 HH bb 38347 HH bb 38347 HH bb 38347 II aa 40937 II aa 40937 II bb 42951 II bb 42951 II bb 42951 II bb 42951 II bb 42951 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} +} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 7558 AA bb 7558 + AA bb 7558 AA bb 7558 BB aa 12025 BB aa 12025 BB aa 12025 + BB aa 12025 BB aa 12025 BB aa 12025 BB bb 13979 BB bb 13979 + BB bb 13979 BB bb 13979 BB bb 13979 BB bb 13979 CC aa 15147 + CC aa 15147 CC aa 15147 CC aa 15147 CC bb 16472 CC bb 16472 + DD aa 19179 DD aa 19179 DD aa 19179 DD bb 20069 DD bb 20069 + DD bb 20069 DD bb 20069 EE aa 21718 EE aa 21718 EE bb 23881 + EE bb 23881 EE bb 23881 FF aa 27386 FF aa 27386 FF aa 27386 + FF aa 27386 FF bb 28983 FF bb 28983 FF bb 28983 FF bb 28983 + FF bb 28983 FF bb 28983 GG aa 31854 GG aa 31854 GG aa 31854 + GG aa 31854 GG bb 34103 GG bb 34103 GG bb 34103 GG bb 34103 + HH aa 37297 HH aa 37297 HH aa 37297 HH bb 38347 HH bb 38347 + HH bb 38347 HH bb 38347 HH bb 38347 HH bb 38347 II aa 40937 + II aa 40937 II bb 42951 II bb 42951 II bb 42951 II bb 42951 + II bb 42951 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 + JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} do_execsql_test 1.3.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.3.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934 CC bb 934 CC bb 934 DD aa 959 DD aa 959 DD aa 959 DD bb 959 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 979 GG bb 979 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979 JJ bb 979 JJ bb 979} +} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 + AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 + BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 + BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934 + CC bb 934 CC bb 934 DD aa 959 DD aa 959 DD aa 959 DD bb 959 + DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 + EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 + FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 + GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 979 GG bb 979 + GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 + JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979 + JJ bb 979 JJ bb 979} do_execsql_test 1.3.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB bb 158 BB bb 158 BB bb 158 BB bb 158 BB bb 158 BB bb 158 CC aa 158 CC aa 158 CC aa 158 CC aa 158 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 113 DD bb 113 DD bb 113 DD bb 113 EE aa 113 EE aa 113 EE bb 113 EE bb 113 EE bb 113 FF aa 102 FF aa 102 FF aa 102 FF aa 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102 II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102 JJ bb 102 JJ bb 102} +} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 + AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 + BB aa 223 BB aa 223 BB bb 158 BB bb 158 BB bb 158 BB bb 158 + BB bb 158 BB bb 158 CC aa 158 CC aa 158 CC aa 158 CC aa 158 + CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 113 + DD bb 113 DD bb 113 DD bb 113 EE aa 113 EE aa 113 EE bb 113 + EE bb 113 EE bb 113 FF aa 102 FF aa 102 FF aa 102 FF aa 102 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102 + HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102 + II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102 + JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102 + JJ bb 102 JJ bb 102} do_execsql_test 1.3.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 11091 AA aa 11114 AA aa 11786 AA aa 11802 AA bb 11155 AA bb 11398 AA bb 11453 AA bb 11716 BB aa 14385 BB aa 14487 BB aa 14735 BB aa 14748 BB aa 14754 BB aa 14900 BB bb 14307 BB bb 14355 BB bb 14361 BB bb 14436 BB bb 14442 BB bb 14514 CC aa 18420 CC aa 18572 CC aa 18749 CC aa 19021 CC bb 18357 CC bb 18833 DD aa 20873 DD aa 21462 DD aa 21494 DD bb 20759 DD bb 20924 DD bb 21002 DD bb 21480 EE aa 26609 EE aa 27273 EE bb 26618 EE bb 26757 EE bb 27134 FF aa 31184 FF aa 31187 FF aa 31236 FF aa 31646 FF bb 30916 FF bb 30984 FF bb 31128 FF bb 31280 FF bb 31559 FF bb 31752 GG aa 36663 GG aa 36817 GG aa 36962 GG aa 37149 GG bb 36359 GG bb 36368 GG bb 36453 GG bb 37137 HH aa 39958 HH aa 40147 HH aa 40457 HH bb 39974 HH bb 40207 HH bb 40254 HH bb 40582 HH bb 40607 HH bb 40804 II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294 II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} +} {AA aa 11091 AA aa 11114 AA aa 11786 AA aa 11802 AA bb 11155 + AA bb 11398 AA bb 11453 AA bb 11716 BB aa 14385 BB aa 14487 + BB aa 14735 BB aa 14748 BB aa 14754 BB aa 14900 BB bb 14307 + BB bb 14355 BB bb 14361 BB bb 14436 BB bb 14442 BB bb 14514 + CC aa 18420 CC aa 18572 CC aa 18749 CC aa 19021 CC bb 18357 + CC bb 18833 DD aa 20873 DD aa 21462 DD aa 21494 DD bb 20759 + DD bb 20924 DD bb 21002 DD bb 21480 EE aa 26609 EE aa 27273 + EE bb 26618 EE bb 26757 EE bb 27134 FF aa 31184 FF aa 31187 + FF aa 31236 FF aa 31646 FF bb 30916 FF bb 30984 FF bb 31128 + FF bb 31280 FF bb 31559 FF bb 31752 GG aa 36663 GG aa 36817 + GG aa 36962 GG aa 37149 GG bb 36359 GG bb 36368 GG bb 36453 + GG bb 37137 HH aa 39958 HH aa 40147 HH aa 40457 HH bb 39974 + HH bb 40207 HH bb 40254 HH bb 40582 HH bb 40607 HH bb 40804 + II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294 + II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503 + JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} do_execsql_test 1.3.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 6688 AA bb 6931 AA bb 6986 AA bb 7249 BB aa 11263 BB aa 11365 BB aa 11613 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 13139 BB bb 13187 BB bb 13193 BB bb 13268 BB bb 13274 BB bb 13346 CC aa 14388 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 15650 CC bb 16126 DD aa 18334 DD aa 18923 DD aa 18955 DD bb 19110 DD bb 19275 DD bb 19353 DD bb 19831 EE aa 20941 EE aa 21605 EE bb 23113 EE bb 23252 EE bb 23629 FF aa 26716 FF aa 26719 FF aa 26768 FF aa 27178 FF bb 28045 FF bb 28113 FF bb 28257 FF bb 28409 FF bb 28688 FF bb 28881 GG aa 31220 GG aa 31374 GG aa 31519 GG aa 31706 GG bb 33165 GG bb 33174 GG bb 33259 GG bb 33943 HH aa 36318 HH aa 36507 HH aa 36817 HH bb 37384 HH bb 37617 HH bb 37664 HH bb 37992 HH bb 38017 HH bb 38214 II aa 40285 II aa 40539 II bb 42146 II bb 42280 II bb 42508 II bb 42530 II bb 42701 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} +} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 6688 AA bb 6931 + AA bb 6986 AA bb 7249 BB aa 11263 BB aa 11365 BB aa 11613 + BB aa 11626 BB aa 11632 BB aa 11778 BB bb 13139 BB bb 13187 + BB bb 13193 BB bb 13268 BB bb 13274 BB bb 13346 CC aa 14388 + CC aa 14540 CC aa 14717 CC aa 14989 CC bb 15650 CC bb 16126 + DD aa 18334 DD aa 18923 DD aa 18955 DD bb 19110 DD bb 19275 + DD bb 19353 DD bb 19831 EE aa 20941 EE aa 21605 EE bb 23113 + EE bb 23252 EE bb 23629 FF aa 26716 FF aa 26719 FF aa 26768 + FF aa 27178 FF bb 28045 FF bb 28113 FF bb 28257 FF bb 28409 + FF bb 28688 FF bb 28881 GG aa 31220 GG aa 31374 GG aa 31519 + GG aa 31706 GG bb 33165 GG bb 33174 GG bb 33259 GG bb 33943 + HH aa 36318 HH aa 36507 HH aa 36817 HH bb 37384 HH bb 37617 + HH bb 37664 HH bb 37992 HH bb 38017 HH bb 38214 II aa 40285 + II aa 40539 II bb 42146 II bb 42280 II bb 42508 II bb 42530 + II bb 42701 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624 + JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} do_execsql_test 1.4.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737 CC bb 44737 DD aa 44737 DD aa 44737 DD aa 44737 DD bb 44737 DD bb 44737 DD bb 44737 DD bb 44737 EE aa 44737 EE aa 44737 EE bb 44737 EE bb 44737 EE bb 44737 FF aa 44737 FF aa 44737 FF aa 44737 FF aa 44737 FF bb 44737 FF bb 44737 FF bb 44737 FF bb 44737 FF bb 44737 FF bb 44737 GG aa 44737 GG aa 44737 GG aa 44737 GG aa 44737 GG bb 44737 GG bb 44737 GG bb 44737 GG bb 44737 HH aa 44737 HH aa 44737 HH aa 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737 II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} +} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 + AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737 + BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737 + BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 + CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737 + CC bb 44737 DD aa 44737 DD aa 44737 DD aa 44737 DD bb 44737 + DD bb 44737 DD bb 44737 DD bb 44737 EE aa 44737 EE aa 44737 + EE bb 44737 EE bb 44737 EE bb 44737 FF aa 44737 FF aa 44737 + FF aa 44737 FF aa 44737 FF bb 44737 FF bb 44737 FF bb 44737 + FF bb 44737 FF bb 44737 FF bb 44737 GG aa 44737 GG aa 44737 + GG aa 44737 GG aa 44737 GG bb 44737 GG bb 44737 GG bb 44737 + GG bb 44737 HH aa 44737 HH aa 44737 HH aa 44737 HH bb 44737 + HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 + II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737 + II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 + JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} do_execsql_test 1.4.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737 CC bb 44737 DD aa 44737 DD aa 44737 DD aa 44737 DD bb 44737 DD bb 44737 DD bb 44737 DD bb 44737 EE aa 44737 EE aa 44737 EE bb 44737 EE bb 44737 EE bb 44737 FF aa 44737 FF aa 44737 FF aa 44737 FF aa 44737 FF bb 44737 FF bb 44737 FF bb 44737 FF bb 44737 FF bb 44737 FF bb 44737 GG aa 44737 GG aa 44737 GG aa 44737 GG aa 44737 GG bb 44737 GG bb 44737 GG bb 44737 GG bb 44737 HH aa 44737 HH aa 44737 HH aa 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737 II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} +} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 + AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737 + BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737 + BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 + CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737 + CC bb 44737 DD aa 44737 DD aa 44737 DD aa 44737 DD bb 44737 + DD bb 44737 DD bb 44737 DD bb 44737 EE aa 44737 EE aa 44737 + EE bb 44737 EE bb 44737 EE bb 44737 FF aa 44737 FF aa 44737 + FF aa 44737 FF aa 44737 FF bb 44737 FF bb 44737 FF bb 44737 + FF bb 44737 FF bb 44737 FF bb 44737 GG aa 44737 GG aa 44737 + GG aa 44737 GG aa 44737 GG bb 44737 GG bb 44737 GG bb 44737 + GG bb 44737 HH aa 44737 HH aa 44737 HH aa 44737 HH bb 44737 + HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 + II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737 + II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737 + JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737} do_execsql_test 1.4.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.4.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979 JJ bb 979 JJ bb 979} +} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 + AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 + BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 + BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 + CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 + DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 + EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 + FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 + GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 + GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 + JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979 + JJ bb 979 JJ bb 979} do_execsql_test 1.4.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102 II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102 JJ bb 102 JJ bb 102} +} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 + AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 + BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 + BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 + CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 + DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 + EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102 + HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102 + II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102 + JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102 + JJ bb 102 JJ bb 102} do_execsql_test 1.4.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077 BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897 BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104 CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915 CC bb 44391 DD aa 43892 DD aa 44481 DD aa 44513 DD bb 43778 DD bb 43943 DD bb 44021 DD bb 44499 EE aa 43960 EE aa 44624 EE bb 43969 EE bb 44108 EE bb 44485 FF aa 44067 FF aa 44070 FF aa 44119 FF aa 44529 FF bb 43799 FF bb 43867 FF bb 44011 FF bb 44163 FF bb 44442 FF bb 44635 GG aa 44103 GG aa 44257 GG aa 44402 GG aa 44589 GG bb 43799 GG bb 43808 GG bb 43893 GG bb 44577 HH aa 43758 HH aa 43947 HH aa 44257 HH bb 43774 HH bb 44007 HH bb 44054 HH bb 44382 HH bb 44407 HH bb 44604 II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294 II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} +} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 + AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077 + BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897 + BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104 + CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915 + CC bb 44391 DD aa 43892 DD aa 44481 DD aa 44513 DD bb 43778 + DD bb 43943 DD bb 44021 DD bb 44499 EE aa 43960 EE aa 44624 + EE bb 43969 EE bb 44108 EE bb 44485 FF aa 44067 FF aa 44070 + FF aa 44119 FF aa 44529 FF bb 43799 FF bb 43867 FF bb 44011 + FF bb 44163 FF bb 44442 FF bb 44635 GG aa 44103 GG aa 44257 + GG aa 44402 GG aa 44589 GG bb 43799 GG bb 43808 GG bb 43893 + GG bb 44577 HH aa 43758 HH aa 43947 HH aa 44257 HH bb 43774 + HH bb 44007 HH bb 44054 HH bb 44382 HH bb 44407 HH bb 44604 + II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294 + II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503 + JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} do_execsql_test 1.4.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077 BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897 BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104 CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915 CC bb 44391 DD aa 43892 DD aa 44481 DD aa 44513 DD bb 43778 DD bb 43943 DD bb 44021 DD bb 44499 EE aa 43960 EE aa 44624 EE bb 43969 EE bb 44108 EE bb 44485 FF aa 44067 FF aa 44070 FF aa 44119 FF aa 44529 FF bb 43799 FF bb 43867 FF bb 44011 FF bb 44163 FF bb 44442 FF bb 44635 GG aa 44103 GG aa 44257 GG aa 44402 GG aa 44589 GG bb 43799 GG bb 43808 GG bb 43893 GG bb 44577 HH aa 43758 HH aa 43947 HH aa 44257 HH bb 43774 HH bb 44007 HH bb 44054 HH bb 44382 HH bb 44407 HH bb 44604 II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294 II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} +} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 + AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077 + BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897 + BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104 + CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915 + CC bb 44391 DD aa 43892 DD aa 44481 DD aa 44513 DD bb 43778 + DD bb 43943 DD bb 44021 DD bb 44499 EE aa 43960 EE aa 44624 + EE bb 43969 EE bb 44108 EE bb 44485 FF aa 44067 FF aa 44070 + FF aa 44119 FF aa 44529 FF bb 43799 FF bb 43867 FF bb 44011 + FF bb 44163 FF bb 44442 FF bb 44635 GG aa 44103 GG aa 44257 + GG aa 44402 GG aa 44589 GG bb 43799 GG bb 43808 GG bb 43893 + GG bb 44577 HH aa 43758 HH aa 43947 HH aa 44257 HH bb 43774 + HH bb 44007 HH bb 44054 HH bb 44382 HH bb 44407 HH bb 44604 + II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294 + II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503 + JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480} do_execsql_test 1.5.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.5.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.5.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.5.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.5.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.5.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.5.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.6.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 CC bb 12025 CC bb 12025 DD aa 10462 DD aa 10462 DD aa 10462 DD bb 10462 DD bb 10462 DD bb 10462 DD bb 10462 EE aa 7154 EE aa 7154 EE bb 7154 EE bb 7154 EE bb 7154 FF aa 6571 FF aa 6571 FF aa 6571 FF aa 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571 GG aa 8207 GG aa 8207 GG aa 8207 GG aa 8207 GG bb 8207 GG bb 8207 GG bb 8207 GG bb 8207 HH aa 10136 HH aa 10136 HH aa 10136 HH bb 10136 HH bb 10136 HH bb 10136 HH bb 10136 HH bb 10136 HH bb 10136 II aa 9911 II aa 9911 II bb 9911 II bb 9911 II bb 9911 II bb 9911 II bb 9911 JJ aa 9083 JJ aa 9083 JJ aa 9083 JJ aa 9083 JJ bb 9083 JJ bb 9083 JJ bb 9083 JJ bb 9083} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 + BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 + CC bb 12025 CC bb 12025 DD aa 10462 DD aa 10462 DD aa 10462 + DD bb 10462 DD bb 10462 DD bb 10462 DD bb 10462 EE aa 7154 + EE aa 7154 EE bb 7154 EE bb 7154 EE bb 7154 FF aa 6571 FF aa 6571 + FF aa 6571 FF aa 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571 + FF bb 6571 FF bb 6571 GG aa 8207 GG aa 8207 GG aa 8207 GG aa 8207 + GG bb 8207 GG bb 8207 GG bb 8207 GG bb 8207 HH aa 10136 + HH aa 10136 HH aa 10136 HH bb 10136 HH bb 10136 HH bb 10136 + HH bb 10136 HH bb 10136 HH bb 10136 II aa 9911 II aa 9911 + II bb 9911 II bb 9911 II bb 9911 II bb 9911 II bb 9911 JJ aa 9083 + JJ aa 9083 JJ aa 9083 JJ aa 9083 JJ bb 9083 JJ bb 9083 JJ bb 9083 + JJ bb 9083} do_execsql_test 1.6.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251 CC aa 7340 CC aa 7340 CC aa 7340 CC aa 7340 CC bb 6421 CC bb 6421 DD aa 3122 DD aa 3122 DD aa 3122 DD bb 2493 DD bb 2493 DD bb 2493 DD bb 2493 EE aa 4032 EE aa 4032 EE bb 3597 EE bb 3597 EE bb 3597 FF aa 2539 FF aa 2539 FF aa 2539 FF aa 2539 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 GG aa 5668 GG aa 5668 GG aa 5668 GG aa 5668 GG bb 5102 GG bb 5102 GG bb 5102 GG bb 5102 HH aa 4468 HH aa 4468 HH aa 4468 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 II aa 5443 II aa 5443 II bb 4244 II bb 4244 II bb 4244 II bb 4244 II bb 4244 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ bb 4604 JJ bb 4604 JJ bb 4604 JJ bb 4604} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 + AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB aa 4685 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251 + BB bb 5251 BB bb 5251 CC aa 7340 CC aa 7340 CC aa 7340 CC aa 7340 + CC bb 6421 CC bb 6421 DD aa 3122 DD aa 3122 DD aa 3122 DD bb 2493 + DD bb 2493 DD bb 2493 DD bb 2493 EE aa 4032 EE aa 4032 EE bb 3597 + EE bb 3597 EE bb 3597 FF aa 2539 FF aa 2539 FF aa 2539 FF aa 2539 + FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 + GG aa 5668 GG aa 5668 GG aa 5668 GG aa 5668 GG bb 5102 GG bb 5102 + GG bb 5102 GG bb 5102 HH aa 4468 HH aa 4468 HH aa 4468 HH bb 5120 + HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 II aa 5443 + II aa 5443 II bb 4244 II bb 4244 II bb 4244 II bb 4244 II bb 4244 + JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ bb 4604 JJ bb 4604 + JJ bb 4604 JJ bb 4604} do_execsql_test 1.6.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.6.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB bb 870 BB bb 870 BB bb 870 BB bb 870 BB bb 870 BB bb 870 CC aa 840 CC aa 840 CC aa 840 CC aa 840 CC bb 840 CC bb 840 DD aa 822 DD aa 822 DD aa 822 DD bb 845 DD bb 845 DD bb 845 DD bb 845 EE aa 959 EE aa 959 EE bb 959 EE bb 959 EE bb 959 FF aa 777 FF aa 777 FF aa 777 FF aa 777 FF bb 768 FF bb 768 FF bb 768 FF bb 768 FF bb 768 FF bb 768 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 GG bb 938 GG bb 938 HH aa 938 HH aa 938 HH aa 938 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963 JJ aa 805 JJ aa 805 JJ aa 805 JJ aa 805 JJ bb 899 JJ bb 899 JJ bb 899 JJ bb 899} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934 + AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 + BB aa 934 BB aa 934 BB bb 870 BB bb 870 BB bb 870 BB bb 870 + BB bb 870 BB bb 870 CC aa 840 CC aa 840 CC aa 840 CC aa 840 + CC bb 840 CC bb 840 DD aa 822 DD aa 822 DD aa 822 DD bb 845 + DD bb 845 DD bb 845 DD bb 845 EE aa 959 EE aa 959 EE bb 959 + EE bb 959 EE bb 959 FF aa 777 FF aa 777 FF aa 777 FF aa 777 + FF bb 768 FF bb 768 FF bb 768 FF bb 768 FF bb 768 FF bb 768 + GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 + GG bb 938 GG bb 938 HH aa 938 HH aa 938 HH aa 938 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963 + JJ aa 805 JJ aa 805 JJ aa 805 JJ aa 805 JJ bb 899 JJ bb 899 + JJ bb 899 JJ bb 899} do_execsql_test 1.6.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB bb 247 BB bb 247 BB bb 247 BB bb 247 BB bb 247 BB bb 247 CC aa 247 CC aa 247 CC aa 247 CC aa 247 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 224 DD bb 224 DD bb 224 DD bb 224 EE aa 224 EE aa 224 EE bb 113 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 FF bb 208 FF bb 208 FF bb 208 FF bb 208 FF bb 208 FF bb 208 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 148 HH aa 148 HH aa 148 HH bb 160 HH bb 160 HH bb 160 HH bb 160 HH bb 160 HH bb 160 II aa 133 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 JJ aa 250 JJ aa 250 JJ aa 250 JJ aa 250 JJ bb 113 JJ bb 113 JJ bb 113 JJ bb 113} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223 + AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 + BB aa 223 BB aa 223 BB bb 247 BB bb 247 BB bb 247 BB bb 247 + BB bb 247 BB bb 247 CC aa 247 CC aa 247 CC aa 247 CC aa 247 + CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 224 + DD bb 224 DD bb 224 DD bb 224 EE aa 224 EE aa 224 EE bb 113 + EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 + FF bb 208 FF bb 208 FF bb 208 FF bb 208 FF bb 208 FF bb 208 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 148 HH aa 148 HH aa 148 HH bb 160 + HH bb 160 HH bb 160 HH bb 160 HH bb 160 HH bb 160 II aa 133 + II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 + JJ aa 250 JJ aa 250 JJ aa 250 JJ aa 250 JJ bb 113 JJ bb 113 + JJ bb 113 JJ bb 113} do_execsql_test 1.6.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 CC bb 12025 CC bb 12025 DD aa 10462 DD aa 10462 DD aa 10462 DD bb 10462 DD bb 10462 DD bb 10462 DD bb 10462 EE aa 7154 EE aa 7154 EE bb 7154 EE bb 7154 EE bb 7154 FF aa 6571 FF aa 6571 FF aa 6571 FF aa 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571 GG aa 8207 GG aa 8207 GG aa 8207 GG aa 8207 GG bb 8207 GG bb 8207 GG bb 8207 GG bb 8207 HH aa 10136 HH aa 10136 HH aa 10136 HH bb 10136 HH bb 10136 HH bb 10136 HH bb 10136 HH bb 10136 HH bb 10136 II aa 9911 II aa 9911 II bb 9911 II bb 9911 II bb 9911 II bb 9911 II bb 9911 JJ aa 9083 JJ aa 9083 JJ aa 9083 JJ aa 9083 JJ bb 9083 JJ bb 9083 JJ bb 9083 JJ bb 9083} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 + BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 + CC bb 12025 CC bb 12025 DD aa 10462 DD aa 10462 DD aa 10462 + DD bb 10462 DD bb 10462 DD bb 10462 DD bb 10462 EE aa 7154 + EE aa 7154 EE bb 7154 EE bb 7154 EE bb 7154 FF aa 6571 FF aa 6571 + FF aa 6571 FF aa 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571 + FF bb 6571 FF bb 6571 GG aa 8207 GG aa 8207 GG aa 8207 GG aa 8207 + GG bb 8207 GG bb 8207 GG bb 8207 GG bb 8207 HH aa 10136 + HH aa 10136 HH aa 10136 HH bb 10136 HH bb 10136 HH bb 10136 + HH bb 10136 HH bb 10136 HH bb 10136 II aa 9911 II aa 9911 + II bb 9911 II bb 9911 II bb 9911 II bb 9911 II bb 9911 JJ aa 9083 + JJ aa 9083 JJ aa 9083 JJ aa 9083 JJ bb 9083 JJ bb 9083 JJ bb 9083 + JJ bb 9083} do_execsql_test 1.6.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251 CC aa 7340 CC aa 7340 CC aa 7340 CC aa 7340 CC bb 6421 CC bb 6421 DD aa 3122 DD aa 3122 DD aa 3122 DD bb 2493 DD bb 2493 DD bb 2493 DD bb 2493 EE aa 4032 EE aa 4032 EE bb 3597 EE bb 3597 EE bb 3597 FF aa 2539 FF aa 2539 FF aa 2539 FF aa 2539 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 GG aa 5668 GG aa 5668 GG aa 5668 GG aa 5668 GG bb 5102 GG bb 5102 GG bb 5102 GG bb 5102 HH aa 4468 HH aa 4468 HH aa 4468 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 II aa 5443 II aa 5443 II bb 4244 II bb 4244 II bb 4244 II bb 4244 II bb 4244 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ bb 4604 JJ bb 4604 JJ bb 4604 JJ bb 4604} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 + AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB aa 4685 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251 + BB bb 5251 BB bb 5251 CC aa 7340 CC aa 7340 CC aa 7340 CC aa 7340 + CC bb 6421 CC bb 6421 DD aa 3122 DD aa 3122 DD aa 3122 DD bb 2493 + DD bb 2493 DD bb 2493 DD bb 2493 EE aa 4032 EE aa 4032 EE bb 3597 + EE bb 3597 EE bb 3597 FF aa 2539 FF aa 2539 FF aa 2539 FF aa 2539 + FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 + GG aa 5668 GG aa 5668 GG aa 5668 GG aa 5668 GG bb 5102 GG bb 5102 + GG bb 5102 GG bb 5102 HH aa 4468 HH aa 4468 HH aa 4468 HH bb 5120 + HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 II aa 5443 + II aa 5443 II bb 4244 II bb 4244 II bb 4244 II bb 4244 II bb 4244 + JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ bb 4604 JJ bb 4604 + JJ bb 4604 JJ bb 4604} do_execsql_test 1.7.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147 DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 14494 EE aa 14494 EE bb 14494 EE bb 14494 EE bb 14494 FF aa 9693 FF aa 9693 FF aa 9693 FF aa 9693 FF bb 9693 FF bb 9693 FF bb 9693 FF bb 9693 FF bb 9693 FF bb 9693 GG aa 12239 GG aa 12239 GG aa 12239 GG aa 12239 GG bb 12239 GG bb 12239 GG bb 12239 GG bb 12239 HH aa 12675 HH aa 12675 HH aa 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 II aa 15579 II aa 15579 II bb 15579 II bb 15579 II bb 15579 II bb 15579 II bb 15579 JJ aa 13551 JJ aa 13551 JJ aa 13551 JJ aa 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 + BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 + CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147 + DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 14494 + EE aa 14494 EE bb 14494 EE bb 14494 EE bb 14494 FF aa 9693 + FF aa 9693 FF aa 9693 FF aa 9693 FF bb 9693 FF bb 9693 FF bb 9693 + FF bb 9693 FF bb 9693 FF bb 9693 GG aa 12239 GG aa 12239 + GG aa 12239 GG aa 12239 GG bb 12239 GG bb 12239 GG bb 12239 + GG bb 12239 HH aa 12675 HH aa 12675 HH aa 12675 HH bb 12675 + HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 + II aa 15579 II aa 15579 II bb 15579 II bb 15579 II bb 15579 + II bb 15579 II bb 15579 JJ aa 13551 JJ aa 13551 JJ aa 13551 + JJ aa 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551} do_execsql_test 1.7.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 CC aa 9718 CC aa 9718 CC aa 9718 CC aa 9718 CC bb 9294 CC bb 9294 DD aa 7589 DD aa 7589 DD aa 7589 DD bb 4447 DD bb 4447 DD bb 4447 DD bb 4447 EE aa 5200 EE aa 5200 EE bb 4922 EE bb 4922 EE bb 4922 FF aa 5246 FF aa 5246 FF aa 5246 FF aa 5246 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 GG aa 7317 GG aa 7317 GG aa 7317 GG aa 7317 GG bb 7265 GG bb 7265 GG bb 7265 GG bb 7265 HH aa 7973 HH aa 7973 HH aa 7973 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 II aa 8314 II aa 8314 II bb 6493 II bb 6493 II bb 6493 II bb 6493 II bb 6493 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ bb 5654 JJ bb 5654 JJ bb 5654 JJ bb 5654} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 + AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 + BB bb 7558 BB bb 7558 CC aa 9718 CC aa 9718 CC aa 9718 CC aa 9718 + CC bb 9294 CC bb 9294 DD aa 7589 DD aa 7589 DD aa 7589 DD bb 4447 + DD bb 4447 DD bb 4447 DD bb 4447 EE aa 5200 EE aa 5200 EE bb 4922 + EE bb 4922 EE bb 4922 FF aa 5246 FF aa 5246 FF aa 5246 FF aa 5246 + FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 + GG aa 7317 GG aa 7317 GG aa 7317 GG aa 7317 GG bb 7265 GG bb 7265 + GG bb 7265 GG bb 7265 HH aa 7973 HH aa 7973 HH aa 7973 HH bb 6717 + HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 II aa 8314 + II aa 8314 II bb 6493 II bb 6493 II bb 6493 II bb 6493 II bb 6493 + JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ bb 5654 JJ bb 5654 + JJ bb 5654 JJ bb 5654} do_execsql_test 1.7.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.7.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870 CC bb 840 CC bb 840 DD aa 840 DD aa 840 DD aa 840 DD bb 845 DD bb 845 DD bb 845 DD bb 845 EE aa 959 EE aa 959 EE bb 959 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 FF bb 777 FF bb 777 FF bb 777 FF bb 777 FF bb 777 FF bb 777 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 GG bb 938 GG bb 938 HH aa 938 HH aa 938 HH aa 938 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899 JJ bb 899 JJ bb 899} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934 + AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 + BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 + BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870 + CC bb 840 CC bb 840 DD aa 840 DD aa 840 DD aa 840 DD bb 845 + DD bb 845 DD bb 845 DD bb 845 EE aa 959 EE aa 959 EE bb 959 + EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 + FF bb 777 FF bb 777 FF bb 777 FF bb 777 FF bb 777 FF bb 777 + GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 + GG bb 938 GG bb 938 HH aa 938 HH aa 938 HH aa 938 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 + JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899 + JJ bb 899 JJ bb 899} do_execsql_test 1.7.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 CC aa 247 CC aa 247 CC aa 247 CC aa 247 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 DD bb 158 DD bb 158 DD bb 158 EE aa 224 EE aa 224 EE bb 113 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 148 HH bb 148 HH bb 148 HH bb 148 HH bb 148 HH bb 148 II aa 133 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 JJ aa 133 JJ aa 133 JJ aa 133 JJ aa 133 JJ bb 113 JJ bb 113 JJ bb 113 JJ bb 113} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223 + AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 + BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 + BB bb 223 BB bb 223 CC aa 247 CC aa 247 CC aa 247 CC aa 247 + CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 + DD bb 158 DD bb 158 DD bb 158 EE aa 224 EE aa 224 EE bb 113 + EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 + FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 148 + HH bb 148 HH bb 148 HH bb 148 HH bb 148 HH bb 148 II aa 133 + II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 + JJ aa 133 JJ aa 133 JJ aa 133 JJ aa 133 JJ bb 113 JJ bb 113 + JJ bb 113 JJ bb 113} do_execsql_test 1.7.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147 DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 14494 EE aa 14494 EE bb 14494 EE bb 14494 EE bb 14494 FF aa 9693 FF aa 9693 FF aa 9693 FF aa 9693 FF bb 9693 FF bb 9693 FF bb 9693 FF bb 9693 FF bb 9693 FF bb 9693 GG aa 12239 GG aa 12239 GG aa 12239 GG aa 12239 GG bb 12239 GG bb 12239 GG bb 12239 GG bb 12239 HH aa 12675 HH aa 12675 HH aa 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 II aa 15579 II aa 15579 II bb 15579 II bb 15579 II bb 15579 II bb 15579 II bb 15579 JJ aa 13551 JJ aa 13551 JJ aa 13551 JJ aa 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 + BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025 + CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147 + DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 14494 + EE aa 14494 EE bb 14494 EE bb 14494 EE bb 14494 FF aa 9693 + FF aa 9693 FF aa 9693 FF aa 9693 FF bb 9693 FF bb 9693 FF bb 9693 + FF bb 9693 FF bb 9693 FF bb 9693 GG aa 12239 GG aa 12239 + GG aa 12239 GG aa 12239 GG bb 12239 GG bb 12239 GG bb 12239 + GG bb 12239 HH aa 12675 HH aa 12675 HH aa 12675 HH bb 12675 + HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 + II aa 15579 II aa 15579 II bb 15579 II bb 15579 II bb 15579 + II bb 15579 II bb 15579 JJ aa 13551 JJ aa 13551 JJ aa 13551 + JJ aa 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551} do_execsql_test 1.7.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 CC aa 9718 CC aa 9718 CC aa 9718 CC aa 9718 CC bb 9294 CC bb 9294 DD aa 7589 DD aa 7589 DD aa 7589 DD bb 4447 DD bb 4447 DD bb 4447 DD bb 4447 EE aa 5200 EE aa 5200 EE bb 4922 EE bb 4922 EE bb 4922 FF aa 5246 FF aa 5246 FF aa 5246 FF aa 5246 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 GG aa 7317 GG aa 7317 GG aa 7317 GG aa 7317 GG bb 7265 GG bb 7265 GG bb 7265 GG bb 7265 HH aa 7973 HH aa 7973 HH aa 7973 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 II aa 8314 II aa 8314 II bb 6493 II bb 6493 II bb 6493 II bb 6493 II bb 6493 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ bb 5654 JJ bb 5654 JJ bb 5654 JJ bb 5654} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307 + AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 + BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558 + BB bb 7558 BB bb 7558 CC aa 9718 CC aa 9718 CC aa 9718 CC aa 9718 + CC bb 9294 CC bb 9294 DD aa 7589 DD aa 7589 DD aa 7589 DD bb 4447 + DD bb 4447 DD bb 4447 DD bb 4447 EE aa 5200 EE aa 5200 EE bb 4922 + EE bb 4922 EE bb 4922 FF aa 5246 FF aa 5246 FF aa 5246 FF aa 5246 + FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 + GG aa 7317 GG aa 7317 GG aa 7317 GG aa 7317 GG bb 7265 GG bb 7265 + GG bb 7265 GG bb 7265 HH aa 7973 HH aa 7973 HH aa 7973 HH bb 6717 + HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 II aa 8314 + II aa 8314 II bb 6493 II bb 6493 II bb 6493 II bb 6493 II bb 6493 + JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ bb 5654 JJ bb 5654 + JJ bb 5654 JJ bb 5654} do_execsql_test 1.8.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147 DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179 DD bb 19179 DD bb 19179 EE aa 17033 EE aa 17033 EE bb 17033 EE bb 17033 EE bb 17033 FF aa 15361 FF aa 15361 FF aa 15361 FF aa 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361 GG aa 16707 GG aa 16707 GG aa 16707 GG aa 16707 GG bb 16707 GG bb 16707 GG bb 16707 GG bb 16707 HH aa 18118 HH aa 18118 HH aa 18118 HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 II aa 19219 II aa 19219 II bb 19219 II bb 19219 II bb 19219 II bb 19219 II bb 19219 JJ aa 17351 JJ aa 17351 JJ aa 17351 JJ aa 17351 JJ bb 17351 JJ bb 17351 JJ bb 17351 JJ bb 17351} +} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025 + BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025 + BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147 + CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147 + DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179 + DD bb 19179 DD bb 19179 EE aa 17033 EE aa 17033 EE bb 17033 + EE bb 17033 EE bb 17033 FF aa 15361 FF aa 15361 FF aa 15361 + FF aa 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361 + FF bb 15361 FF bb 15361 GG aa 16707 GG aa 16707 GG aa 16707 + GG aa 16707 GG bb 16707 GG bb 16707 GG bb 16707 GG bb 16707 + HH aa 18118 HH aa 18118 HH aa 18118 HH bb 18118 HH bb 18118 + HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 II aa 19219 + II aa 19219 II bb 19219 II bb 19219 II bb 19219 II bb 19219 + II bb 19219 JJ aa 17351 JJ aa 17351 JJ aa 17351 JJ aa 17351 + JJ bb 17351 JJ bb 17351 JJ bb 17351 JJ bb 17351} do_execsql_test 1.8.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 11672 CC aa 11672 CC aa 11672 CC aa 11672 CC bb 10462 CC bb 10462 DD aa 8914 DD aa 8914 DD aa 8914 DD bb 7154 DD bb 7154 DD bb 7154 DD bb 7154 EE aa 6090 EE aa 6090 EE bb 6571 EE bb 6571 EE bb 6571 FF aa 7409 FF aa 7409 FF aa 7409 FF aa 7409 FF bb 8207 FF bb 8207 FF bb 8207 FF bb 8207 FF bb 8207 FF bb 8207 GG aa 8914 GG aa 8914 GG aa 8914 GG aa 8914 GG bb 10136 GG bb 10136 GG bb 10136 GG bb 10136 HH aa 10222 HH aa 10222 HH aa 10222 HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 II aa 9364 II aa 9364 II bb 9083 II bb 9083 II bb 9083 II bb 9083 II bb 9083 JJ aa 8848 JJ aa 8848 JJ aa 8848 JJ aa 8848 JJ bb 7440 JJ bb 7440 JJ bb 7440 JJ bb 7440} +} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 + BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025 + BB bb 12025 BB bb 12025 BB bb 12025 CC aa 11672 CC aa 11672 + CC aa 11672 CC aa 11672 CC bb 10462 CC bb 10462 DD aa 8914 + DD aa 8914 DD aa 8914 DD bb 7154 DD bb 7154 DD bb 7154 DD bb 7154 + EE aa 6090 EE aa 6090 EE bb 6571 EE bb 6571 EE bb 6571 FF aa 7409 + FF aa 7409 FF aa 7409 FF aa 7409 FF bb 8207 FF bb 8207 FF bb 8207 + FF bb 8207 FF bb 8207 FF bb 8207 GG aa 8914 GG aa 8914 GG aa 8914 + GG aa 8914 GG bb 10136 GG bb 10136 GG bb 10136 GG bb 10136 + HH aa 10222 HH aa 10222 HH aa 10222 HH bb 9911 HH bb 9911 + HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 II aa 9364 II aa 9364 + II bb 9083 II bb 9083 II bb 9083 II bb 9083 II bb 9083 JJ aa 8848 + JJ aa 8848 JJ aa 8848 JJ aa 8848 JJ bb 7440 JJ bb 7440 JJ bb 7440 + JJ bb 7440} do_execsql_test 1.8.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.8.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870 CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899 JJ bb 899 JJ bb 899} +} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 + AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 + BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 + BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870 + CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959 + DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 + EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 + FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 + GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 + GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 + JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899 + JJ bb 899 JJ bb 899} do_execsql_test 1.8.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113 JJ bb 113 JJ bb 113} +} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 + AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 + BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 + BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158 + CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 + DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113 + EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 133 + HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133 + II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113 + JJ bb 113 JJ bb 113} do_execsql_test 1.8.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801 DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385 DD bb 18463 DD bb 18941 EE aa 16256 EE aa 16920 EE bb 16265 EE bb 16404 EE bb 16781 FF aa 14691 FF aa 14694 FF aa 14743 FF aa 15153 FF bb 14423 FF bb 14491 FF bb 14635 FF bb 14787 FF bb 15066 FF bb 15259 GG aa 16073 GG aa 16227 GG aa 16372 GG aa 16559 GG bb 15769 GG bb 15778 GG bb 15863 GG bb 16547 HH aa 17139 HH aa 17328 HH aa 17638 HH bb 17155 HH bb 17388 HH bb 17435 HH bb 17763 HH bb 17788 HH bb 17985 II aa 18567 II aa 18821 II bb 18414 II bb 18548 II bb 18776 II bb 18798 II bb 18969 JJ aa 16452 JJ aa 16583 JJ aa 17117 JJ aa 17238 JJ bb 16512 JJ bb 16997 JJ bb 17015 JJ bb 17094} +} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613 + BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233 + BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388 + CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801 + DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385 + DD bb 18463 DD bb 18941 EE aa 16256 EE aa 16920 EE bb 16265 + EE bb 16404 EE bb 16781 FF aa 14691 FF aa 14694 FF aa 14743 + FF aa 15153 FF bb 14423 FF bb 14491 FF bb 14635 FF bb 14787 + FF bb 15066 FF bb 15259 GG aa 16073 GG aa 16227 GG aa 16372 + GG aa 16559 GG bb 15769 GG bb 15778 GG bb 15863 GG bb 16547 + HH aa 17139 HH aa 17328 HH aa 17638 HH bb 17155 HH bb 17388 + HH bb 17435 HH bb 17763 HH bb 17788 HH bb 17985 II aa 18567 + II aa 18821 II bb 18414 II bb 18548 II bb 18776 II bb 18798 + II bb 18969 JJ aa 16452 JJ aa 16583 JJ aa 17117 JJ aa 17238 + JJ bb 16512 JJ bb 16997 JJ bb 17015 JJ bb 17094} do_execsql_test 1.8.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159 BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 10913 CC aa 11065 CC aa 11242 CC aa 11514 CC bb 9640 CC bb 10116 DD aa 8069 DD aa 8658 DD aa 8690 DD bb 6195 DD bb 6360 DD bb 6438 DD bb 6916 EE aa 5313 EE aa 5977 EE bb 5803 EE bb 5942 EE bb 6319 FF aa 6739 FF aa 6742 FF aa 6791 FF aa 7201 FF bb 7269 FF bb 7337 FF bb 7481 FF bb 7633 FF bb 7912 FF bb 8105 GG aa 8280 GG aa 8434 GG aa 8579 GG aa 8766 GG bb 9198 GG bb 9207 GG bb 9292 GG bb 9976 HH aa 9243 HH aa 9432 HH aa 9742 HH bb 8948 HH bb 9181 HH bb 9228 HH bb 9556 HH bb 9581 HH bb 9778 II aa 8712 II aa 8966 II bb 8278 II bb 8412 II bb 8640 II bb 8662 II bb 8833 JJ aa 7949 JJ aa 8080 JJ aa 8614 JJ aa 8735 JJ bb 6601 JJ bb 7086 JJ bb 7104 JJ bb 7183} +} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159 + BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239 + BB bb 11314 BB bb 11320 BB bb 11392 CC aa 10913 CC aa 11065 + CC aa 11242 CC aa 11514 CC bb 9640 CC bb 10116 DD aa 8069 + DD aa 8658 DD aa 8690 DD bb 6195 DD bb 6360 DD bb 6438 DD bb 6916 + EE aa 5313 EE aa 5977 EE bb 5803 EE bb 5942 EE bb 6319 FF aa 6739 + FF aa 6742 FF aa 6791 FF aa 7201 FF bb 7269 FF bb 7337 FF bb 7481 + FF bb 7633 FF bb 7912 FF bb 8105 GG aa 8280 GG aa 8434 GG aa 8579 + GG aa 8766 GG bb 9198 GG bb 9207 GG bb 9292 GG bb 9976 HH aa 9243 + HH aa 9432 HH aa 9742 HH bb 8948 HH bb 9181 HH bb 9228 HH bb 9556 + HH bb 9581 HH bb 9778 II aa 8712 II aa 8966 II bb 8278 II bb 8412 + II bb 8640 II bb 8662 II bb 8833 JJ aa 7949 JJ aa 8080 JJ aa 8614 + JJ aa 8735 JJ bb 6601 JJ bb 7086 JJ bb 7104 JJ bb 7183} do_execsql_test 1.9.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147 DD aa 14494 DD aa 14494 DD aa 14494 DD bb 14494 DD bb 14494 DD bb 14494 DD bb 14494 EE aa 9693 EE aa 9693 EE bb 9693 EE bb 9693 EE bb 9693 FF aa 12239 FF aa 12239 FF aa 12239 FF aa 12239 FF bb 12239 FF bb 12239 FF bb 12239 FF bb 12239 FF bb 12239 FF bb 12239 GG aa 12675 GG aa 12675 GG aa 12675 GG aa 12675 GG bb 12675 GG bb 12675 GG bb 12675 GG bb 12675 HH aa 15579 HH aa 15579 HH aa 15579 HH bb 15579 HH bb 15579 HH bb 15579 HH bb 15579 HH bb 15579 HH bb 15579 II aa 13551 II aa 13551 II bb 13551 II bb 13551 II bb 13551 II bb 13551 II bb 13551 JJ aa 12883 JJ aa 12883 JJ aa 12883 JJ aa 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883} +} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025 + BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025 + BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147 + CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147 + DD aa 14494 DD aa 14494 DD aa 14494 DD bb 14494 DD bb 14494 + DD bb 14494 DD bb 14494 EE aa 9693 EE aa 9693 EE bb 9693 + EE bb 9693 EE bb 9693 FF aa 12239 FF aa 12239 FF aa 12239 + FF aa 12239 FF bb 12239 FF bb 12239 FF bb 12239 FF bb 12239 + FF bb 12239 FF bb 12239 GG aa 12675 GG aa 12675 GG aa 12675 + GG aa 12675 GG bb 12675 GG bb 12675 GG bb 12675 GG bb 12675 + HH aa 15579 HH aa 15579 HH aa 15579 HH bb 15579 HH bb 15579 + HH bb 15579 HH bb 15579 HH bb 15579 HH bb 15579 II aa 13551 + II aa 13551 II bb 13551 II bb 13551 II bb 13551 II bb 13551 + II bb 13551 JJ aa 12883 JJ aa 12883 JJ aa 12883 JJ aa 12883 + JJ bb 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883} do_execsql_test 1.9.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB bb 9718 BB bb 9718 BB bb 9718 BB bb 9718 BB bb 9718 BB bb 9718 CC aa 9294 CC aa 9294 CC aa 9294 CC aa 9294 CC bb 7589 CC bb 7589 DD aa 4447 DD aa 4447 DD aa 4447 DD bb 5200 DD bb 5200 DD bb 5200 DD bb 5200 EE aa 4922 EE aa 4922 EE bb 5246 EE bb 5246 EE bb 5246 FF aa 4702 FF aa 4702 FF aa 4702 FF aa 4702 FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317 GG aa 7265 GG aa 7265 GG aa 7265 GG aa 7265 GG bb 7973 GG bb 7973 GG bb 7973 GG bb 7973 HH aa 6717 HH aa 6717 HH aa 6717 HH bb 8314 HH bb 8314 HH bb 8314 HH bb 8314 HH bb 8314 HH bb 8314 II aa 6493 II aa 6493 II bb 6834 II bb 6834 II bb 6834 II bb 6834 II bb 6834 JJ aa 5654 JJ aa 5654 JJ aa 5654 JJ aa 5654 JJ bb 6390 JJ bb 6390 JJ bb 6390 JJ bb 6390} +} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 + BB aa 7558 BB aa 7558 BB bb 9718 BB bb 9718 BB bb 9718 BB bb 9718 + BB bb 9718 BB bb 9718 CC aa 9294 CC aa 9294 CC aa 9294 CC aa 9294 + CC bb 7589 CC bb 7589 DD aa 4447 DD aa 4447 DD aa 4447 DD bb 5200 + DD bb 5200 DD bb 5200 DD bb 5200 EE aa 4922 EE aa 4922 EE bb 5246 + EE bb 5246 EE bb 5246 FF aa 4702 FF aa 4702 FF aa 4702 FF aa 4702 + FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317 + GG aa 7265 GG aa 7265 GG aa 7265 GG aa 7265 GG bb 7973 GG bb 7973 + GG bb 7973 GG bb 7973 HH aa 6717 HH aa 6717 HH aa 6717 HH bb 8314 + HH bb 8314 HH bb 8314 HH bb 8314 HH bb 8314 HH bb 8314 II aa 6493 + II aa 6493 II bb 6834 II bb 6834 II bb 6834 II bb 6834 II bb 6834 + JJ aa 5654 JJ aa 5654 JJ aa 5654 JJ aa 5654 JJ bb 6390 JJ bb 6390 + JJ bb 6390 JJ bb 6390} do_execsql_test 1.9.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.9.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB bb 870 BB bb 870 BB bb 870 BB bb 870 BB bb 870 BB bb 870 CC aa 840 CC aa 840 CC aa 840 CC aa 840 CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 EE bb 959 EE bb 959 FF aa 777 FF aa 777 FF aa 777 FF aa 777 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 899 JJ bb 899 JJ bb 899 JJ bb 899} +} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 + AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 + BB aa 934 BB aa 934 BB bb 870 BB bb 870 BB bb 870 BB bb 870 + BB bb 870 BB bb 870 CC aa 840 CC aa 840 CC aa 840 CC aa 840 + CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959 + DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 + EE bb 959 EE bb 959 FF aa 777 FF aa 777 FF aa 777 FF aa 777 + FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 + GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 + GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963 + JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 899 JJ bb 899 + JJ bb 899 JJ bb 899} do_execsql_test 1.9.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB bb 247 BB bb 247 BB bb 247 BB bb 247 BB bb 247 BB bb 247 CC aa 158 CC aa 158 CC aa 158 CC aa 158 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 224 DD bb 224 DD bb 224 DD bb 224 EE aa 113 EE aa 113 EE bb 113 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 148 HH aa 148 HH aa 148 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113 JJ bb 113 JJ bb 113} +} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 + AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 + BB aa 223 BB aa 223 BB bb 247 BB bb 247 BB bb 247 BB bb 247 + BB bb 247 BB bb 247 CC aa 158 CC aa 158 CC aa 158 CC aa 158 + CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 224 + DD bb 224 DD bb 224 DD bb 224 EE aa 113 EE aa 113 EE bb 113 + EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 148 HH aa 148 HH aa 148 HH bb 133 + HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133 + II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113 + JJ bb 113 JJ bb 113} do_execsql_test 1.9.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801 DD aa 13649 DD aa 14238 DD aa 14270 DD bb 13535 DD bb 13700 DD bb 13778 DD bb 14256 EE aa 8916 EE aa 9580 EE bb 8925 EE bb 9064 EE bb 9441 FF aa 11569 FF aa 11572 FF aa 11621 FF aa 12031 FF bb 11301 FF bb 11369 FF bb 11513 FF bb 11665 FF bb 11944 FF bb 12137 GG aa 12041 GG aa 12195 GG aa 12340 GG aa 12527 GG bb 11737 GG bb 11746 GG bb 11831 GG bb 12515 HH aa 14600 HH aa 14789 HH aa 15099 HH bb 14616 HH bb 14849 HH bb 14896 HH bb 15224 HH bb 15249 HH bb 15446 II aa 12899 II aa 13153 II bb 12746 II bb 12880 II bb 13108 II bb 13130 II bb 13301 JJ aa 11984 JJ aa 12115 JJ aa 12649 JJ aa 12770 JJ bb 12044 JJ bb 12529 JJ bb 12547 JJ bb 12626} +} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613 + BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233 + BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388 + CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801 + DD aa 13649 DD aa 14238 DD aa 14270 DD bb 13535 DD bb 13700 + DD bb 13778 DD bb 14256 EE aa 8916 EE aa 9580 EE bb 8925 + EE bb 9064 EE bb 9441 FF aa 11569 FF aa 11572 FF aa 11621 + FF aa 12031 FF bb 11301 FF bb 11369 FF bb 11513 FF bb 11665 + FF bb 11944 FF bb 12137 GG aa 12041 GG aa 12195 GG aa 12340 + GG aa 12527 GG bb 11737 GG bb 11746 GG bb 11831 GG bb 12515 + HH aa 14600 HH aa 14789 HH aa 15099 HH bb 14616 HH bb 14849 + HH bb 14896 HH bb 15224 HH bb 15249 HH bb 15446 II aa 12899 + II aa 13153 II bb 12746 II bb 12880 II bb 13108 II bb 13130 + II bb 13301 JJ aa 11984 JJ aa 12115 JJ aa 12649 JJ aa 12770 + JJ bb 12044 JJ bb 12529 JJ bb 12547 JJ bb 12626} do_execsql_test 1.9.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159 BB aa 7165 BB aa 7311 BB bb 8878 BB bb 8926 BB bb 8932 BB bb 9007 BB bb 9013 BB bb 9085 CC aa 8535 CC aa 8687 CC aa 8864 CC aa 9136 CC bb 6767 CC bb 7243 DD aa 3602 DD aa 4191 DD aa 4223 DD bb 4241 DD bb 4406 DD bb 4484 DD bb 4962 EE aa 4145 EE aa 4809 EE bb 4478 EE bb 4617 EE bb 4994 FF aa 4032 FF aa 4035 FF aa 4084 FF aa 4494 FF bb 6379 FF bb 6447 FF bb 6591 FF bb 6743 FF bb 7022 FF bb 7215 GG aa 6631 GG aa 6785 GG aa 6930 GG aa 7117 GG bb 7035 GG bb 7044 GG bb 7129 GG bb 7813 HH aa 5738 HH aa 5927 HH aa 6237 HH bb 7351 HH bb 7584 HH bb 7631 HH bb 7959 HH bb 7984 HH bb 8181 II aa 5841 II aa 6095 II bb 6029 II bb 6163 II bb 6391 II bb 6413 II bb 6584 JJ aa 4755 JJ aa 4886 JJ aa 5420 JJ aa 5541 JJ bb 5551 JJ bb 6036 JJ bb 6054 JJ bb 6133} +} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159 + BB aa 7165 BB aa 7311 BB bb 8878 BB bb 8926 BB bb 8932 BB bb 9007 + BB bb 9013 BB bb 9085 CC aa 8535 CC aa 8687 CC aa 8864 CC aa 9136 + CC bb 6767 CC bb 7243 DD aa 3602 DD aa 4191 DD aa 4223 DD bb 4241 + DD bb 4406 DD bb 4484 DD bb 4962 EE aa 4145 EE aa 4809 EE bb 4478 + EE bb 4617 EE bb 4994 FF aa 4032 FF aa 4035 FF aa 4084 FF aa 4494 + FF bb 6379 FF bb 6447 FF bb 6591 FF bb 6743 FF bb 7022 FF bb 7215 + GG aa 6631 GG aa 6785 GG aa 6930 GG aa 7117 GG bb 7035 GG bb 7044 + GG bb 7129 GG bb 7813 HH aa 5738 HH aa 5927 HH aa 6237 HH bb 7351 + HH bb 7584 HH bb 7631 HH bb 7959 HH bb 7984 HH bb 8181 II aa 5841 + II aa 6095 II bb 6029 II bb 6163 II bb 6391 II bb 6413 II bb 6584 + JJ aa 4755 JJ aa 4886 JJ aa 5420 JJ aa 5541 JJ bb 5551 JJ bb 6036 + JJ bb 6054 JJ bb 6133} do_execsql_test 1.10.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147 DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179 DD bb 19179 DD bb 19179 EE aa 17033 EE aa 17033 EE bb 17033 EE bb 17033 EE bb 17033 FF aa 15361 FF aa 15361 FF aa 15361 FF aa 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361 GG aa 16707 GG aa 16707 GG aa 16707 GG aa 16707 GG bb 16707 GG bb 16707 GG bb 16707 GG bb 16707 HH aa 18118 HH aa 18118 HH aa 18118 HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 II aa 19219 II aa 19219 II bb 19219 II bb 19219 II bb 19219 II bb 19219 II bb 19219 JJ aa 17351 JJ aa 17351 JJ aa 17351 JJ aa 17351 JJ bb 17351 JJ bb 17351 JJ bb 17351 JJ bb 17351} +} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025 + BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025 + BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147 + CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147 + DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179 + DD bb 19179 DD bb 19179 EE aa 17033 EE aa 17033 EE bb 17033 + EE bb 17033 EE bb 17033 FF aa 15361 FF aa 15361 FF aa 15361 + FF aa 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361 + FF bb 15361 FF bb 15361 GG aa 16707 GG aa 16707 GG aa 16707 + GG aa 16707 GG bb 16707 GG bb 16707 GG bb 16707 GG bb 16707 + HH aa 18118 HH aa 18118 HH aa 18118 HH bb 18118 HH bb 18118 + HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 II aa 19219 + II aa 19219 II bb 19219 II bb 19219 II bb 19219 II bb 19219 + II bb 19219 JJ aa 17351 JJ aa 17351 JJ aa 17351 JJ aa 17351 + JJ bb 17351 JJ bb 17351 JJ bb 17351 JJ bb 17351} do_execsql_test 1.10.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 11672 CC aa 11672 CC aa 11672 CC aa 11672 CC bb 10462 CC bb 10462 DD aa 8914 DD aa 8914 DD aa 8914 DD bb 7154 DD bb 7154 DD bb 7154 DD bb 7154 EE aa 6090 EE aa 6090 EE bb 6571 EE bb 6571 EE bb 6571 FF aa 7409 FF aa 7409 FF aa 7409 FF aa 7409 FF bb 8207 FF bb 8207 FF bb 8207 FF bb 8207 FF bb 8207 FF bb 8207 GG aa 8914 GG aa 8914 GG aa 8914 GG aa 8914 GG bb 10136 GG bb 10136 GG bb 10136 GG bb 10136 HH aa 10222 HH aa 10222 HH aa 10222 HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 II aa 9364 II aa 9364 II bb 9083 II bb 9083 II bb 9083 II bb 9083 II bb 9083 JJ aa 8848 JJ aa 8848 JJ aa 8848 JJ aa 8848 JJ bb 7440 JJ bb 7440 JJ bb 7440 JJ bb 7440} +} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558 + BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025 + BB bb 12025 BB bb 12025 BB bb 12025 CC aa 11672 CC aa 11672 + CC aa 11672 CC aa 11672 CC bb 10462 CC bb 10462 DD aa 8914 + DD aa 8914 DD aa 8914 DD bb 7154 DD bb 7154 DD bb 7154 DD bb 7154 + EE aa 6090 EE aa 6090 EE bb 6571 EE bb 6571 EE bb 6571 FF aa 7409 + FF aa 7409 FF aa 7409 FF aa 7409 FF bb 8207 FF bb 8207 FF bb 8207 + FF bb 8207 FF bb 8207 FF bb 8207 GG aa 8914 GG aa 8914 GG aa 8914 + GG aa 8914 GG bb 10136 GG bb 10136 GG bb 10136 GG bb 10136 + HH aa 10222 HH aa 10222 HH aa 10222 HH bb 9911 HH bb 9911 + HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 II aa 9364 II aa 9364 + II bb 9083 II bb 9083 II bb 9083 II bb 9083 II bb 9083 JJ aa 8848 + JJ aa 8848 JJ aa 8848 JJ aa 8848 JJ bb 7440 JJ bb 7440 JJ bb 7440 + JJ bb 7440} do_execsql_test 1.10.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.10.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870 CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899 JJ bb 899 JJ bb 899} +} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934 + AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934 + BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934 + BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870 + CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959 + DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959 + EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959 + FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 + GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938 + GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979 + JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899 + JJ bb 899 JJ bb 899} do_execsql_test 1.10.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113 JJ bb 113 JJ bb 113} +} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223 + AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223 + BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223 + BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158 + CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158 + DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113 + EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 133 + HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133 + II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113 + JJ bb 113 JJ bb 113} do_execsql_test 1.10.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801 DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385 DD bb 18463 DD bb 18941 EE aa 16256 EE aa 16920 EE bb 16265 EE bb 16404 EE bb 16781 FF aa 14691 FF aa 14694 FF aa 14743 FF aa 15153 FF bb 14423 FF bb 14491 FF bb 14635 FF bb 14787 FF bb 15066 FF bb 15259 GG aa 16073 GG aa 16227 GG aa 16372 GG aa 16559 GG bb 15769 GG bb 15778 GG bb 15863 GG bb 16547 HH aa 17139 HH aa 17328 HH aa 17638 HH bb 17155 HH bb 17388 HH bb 17435 HH bb 17763 HH bb 17788 HH bb 17985 II aa 18567 II aa 18821 II bb 18414 II bb 18548 II bb 18776 II bb 18798 II bb 18969 JJ aa 16452 JJ aa 16583 JJ aa 17117 JJ aa 17238 JJ bb 16512 JJ bb 16997 JJ bb 17015 JJ bb 17094} +} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613 + BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233 + BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388 + CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801 + DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385 + DD bb 18463 DD bb 18941 EE aa 16256 EE aa 16920 EE bb 16265 + EE bb 16404 EE bb 16781 FF aa 14691 FF aa 14694 FF aa 14743 + FF aa 15153 FF bb 14423 FF bb 14491 FF bb 14635 FF bb 14787 + FF bb 15066 FF bb 15259 GG aa 16073 GG aa 16227 GG aa 16372 + GG aa 16559 GG bb 15769 GG bb 15778 GG bb 15863 GG bb 16547 + HH aa 17139 HH aa 17328 HH aa 17638 HH bb 17155 HH bb 17388 + HH bb 17435 HH bb 17763 HH bb 17788 HH bb 17985 II aa 18567 + II aa 18821 II bb 18414 II bb 18548 II bb 18776 II bb 18798 + II bb 18969 JJ aa 16452 JJ aa 16583 JJ aa 17117 JJ aa 17238 + JJ bb 16512 JJ bb 16997 JJ bb 17015 JJ bb 17094} do_execsql_test 1.10.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159 BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 10913 CC aa 11065 CC aa 11242 CC aa 11514 CC bb 9640 CC bb 10116 DD aa 8069 DD aa 8658 DD aa 8690 DD bb 6195 DD bb 6360 DD bb 6438 DD bb 6916 EE aa 5313 EE aa 5977 EE bb 5803 EE bb 5942 EE bb 6319 FF aa 6739 FF aa 6742 FF aa 6791 FF aa 7201 FF bb 7269 FF bb 7337 FF bb 7481 FF bb 7633 FF bb 7912 FF bb 8105 GG aa 8280 GG aa 8434 GG aa 8579 GG aa 8766 GG bb 9198 GG bb 9207 GG bb 9292 GG bb 9976 HH aa 9243 HH aa 9432 HH aa 9742 HH bb 8948 HH bb 9181 HH bb 9228 HH bb 9556 HH bb 9581 HH bb 9778 II aa 8712 II aa 8966 II bb 8278 II bb 8412 II bb 8640 II bb 8662 II bb 8833 JJ aa 7949 JJ aa 8080 JJ aa 8614 JJ aa 8735 JJ bb 6601 JJ bb 7086 JJ bb 7104 JJ bb 7183} +} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159 + BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239 + BB bb 11314 BB bb 11320 BB bb 11392 CC aa 10913 CC aa 11065 + CC aa 11242 CC aa 11514 CC bb 9640 CC bb 10116 DD aa 8069 + DD aa 8658 DD aa 8690 DD bb 6195 DD bb 6360 DD bb 6438 DD bb 6916 + EE aa 5313 EE aa 5977 EE bb 5803 EE bb 5942 EE bb 6319 FF aa 6739 + FF aa 6742 FF aa 6791 FF aa 7201 FF bb 7269 FF bb 7337 FF bb 7481 + FF bb 7633 FF bb 7912 FF bb 8105 GG aa 8280 GG aa 8434 GG aa 8579 + GG aa 8766 GG bb 9198 GG bb 9207 GG bb 9292 GG bb 9976 HH aa 9243 + HH aa 9432 HH aa 9742 HH bb 8948 HH bb 9181 HH bb 9228 HH bb 9556 + HH bb 9581 HH bb 9778 II aa 8712 II aa 8966 II bb 8278 II bb 8412 + II bb 8640 II bb 8662 II bb 8833 JJ aa 7949 JJ aa 8080 JJ aa 8614 + JJ aa 8735 JJ bb 6601 JJ bb 7086 JJ bb 7104 JJ bb 7183} do_execsql_test 1.11.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737 CC bb 44737 DD aa 40052 DD aa 40052 DD aa 40052 DD bb 40052 DD bb 40052 DD bb 40052 DD bb 40052 EE aa 32712 EE aa 32712 EE bb 32712 EE bb 32712 EE bb 32712 FF aa 29590 FF aa 29590 FF aa 29590 FF aa 29590 FF bb 29590 FF bb 29590 FF bb 29590 FF bb 29590 FF bb 29590 FF bb 29590 GG aa 25558 GG aa 25558 GG aa 25558 GG aa 25558 GG bb 25558 GG bb 25558 GG bb 25558 GG bb 25558 HH aa 23019 HH aa 23019 HH aa 23019 HH bb 23019 HH bb 23019 HH bb 23019 HH bb 23019 HH bb 23019 HH bb 23019 II aa 17351 II aa 17351 II bb 17351 II bb 17351 II bb 17351 II bb 17351 II bb 17351 JJ aa 12883 JJ aa 12883 JJ aa 12883 JJ aa 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883} +} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 + AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737 + BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737 + BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 + CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737 + CC bb 44737 DD aa 40052 DD aa 40052 DD aa 40052 DD bb 40052 + DD bb 40052 DD bb 40052 DD bb 40052 EE aa 32712 EE aa 32712 + EE bb 32712 EE bb 32712 EE bb 32712 FF aa 29590 FF aa 29590 + FF aa 29590 FF aa 29590 FF bb 29590 FF bb 29590 FF bb 29590 + FF bb 29590 FF bb 29590 FF bb 29590 GG aa 25558 GG aa 25558 + GG aa 25558 GG aa 25558 GG bb 25558 GG bb 25558 GG bb 25558 + GG bb 25558 HH aa 23019 HH aa 23019 HH aa 23019 HH bb 23019 + HH bb 23019 HH bb 23019 HH bb 23019 HH bb 23019 HH bb 23019 + II aa 17351 II aa 17351 II bb 17351 II bb 17351 II bb 17351 + II bb 17351 II bb 17351 JJ aa 12883 JJ aa 12883 JJ aa 12883 + JJ aa 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883} do_execsql_test 1.11.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 42430 BB bb 42430 BB bb 42430 BB bb 42430 BB bb 42430 BB bb 42430 CC aa 40052 CC aa 40052 CC aa 40052 CC aa 40052 CC bb 37179 CC bb 37179 DD aa 32712 DD aa 32712 DD aa 32712 DD bb 30758 DD bb 30758 DD bb 30758 DD bb 30758 EE aa 29590 EE aa 29590 EE bb 28265 EE bb 28265 EE bb 28265 FF aa 25558 FF aa 25558 FF aa 25558 FF aa 25558 FF bb 24668 FF bb 24668 FF bb 24668 FF bb 24668 FF bb 24668 FF bb 24668 GG aa 23019 GG aa 23019 GG aa 23019 GG aa 23019 GG bb 20856 GG bb 20856 GG bb 20856 GG bb 20856 HH aa 17351 HH aa 17351 HH aa 17351 HH bb 15754 HH bb 15754 HH bb 15754 HH bb 15754 HH bb 15754 HH bb 15754 II aa 12883 II aa 12883 II bb 10634 II bb 10634 II bb 10634 II bb 10634 II bb 10634 JJ aa 7440 JJ aa 7440 JJ aa 7440 JJ aa 7440 JJ bb 6390 JJ bb 6390 JJ bb 6390 JJ bb 6390} +} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 + AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737 + BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 42430 + BB bb 42430 BB bb 42430 BB bb 42430 BB bb 42430 BB bb 42430 + CC aa 40052 CC aa 40052 CC aa 40052 CC aa 40052 CC bb 37179 + CC bb 37179 DD aa 32712 DD aa 32712 DD aa 32712 DD bb 30758 + DD bb 30758 DD bb 30758 DD bb 30758 EE aa 29590 EE aa 29590 + EE bb 28265 EE bb 28265 EE bb 28265 FF aa 25558 FF aa 25558 + FF aa 25558 FF aa 25558 FF bb 24668 FF bb 24668 FF bb 24668 + FF bb 24668 FF bb 24668 FF bb 24668 GG aa 23019 GG aa 23019 + GG aa 23019 GG aa 23019 GG bb 20856 GG bb 20856 GG bb 20856 + GG bb 20856 HH aa 17351 HH aa 17351 HH aa 17351 HH bb 15754 + HH bb 15754 HH bb 15754 HH bb 15754 HH bb 15754 HH bb 15754 + II aa 12883 II aa 12883 II bb 10634 II bb 10634 II bb 10634 + II bb 10634 II bb 10634 JJ aa 7440 JJ aa 7440 JJ aa 7440 + JJ aa 7440 JJ bb 6390 JJ bb 6390 JJ bb 6390 JJ bb 6390} do_execsql_test 1.11.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.11.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 899 JJ bb 899 JJ bb 899 JJ bb 899} +} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 + AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 + BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 + BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 + CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 + DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 + EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 + FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 + GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 + GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979 + HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979 + II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963 + JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 899 JJ bb 899 + JJ bb 899 JJ bb 899} do_execsql_test 1.11.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 GG bb 102 GG bb 102 HH aa 113 HH aa 113 HH aa 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113 JJ bb 113 JJ bb 113} +} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 + AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 + BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 + BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 + CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 + DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 + EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102 + GG bb 102 GG bb 102 HH aa 113 HH aa 113 HH aa 113 HH bb 113 + HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 + II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113 + JJ bb 113 JJ bb 113} do_execsql_test 1.11.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077 BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897 BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104 CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915 CC bb 44391 DD aa 39207 DD aa 39796 DD aa 39828 DD bb 39093 DD bb 39258 DD bb 39336 DD bb 39814 EE aa 31935 EE aa 32599 EE bb 31944 EE bb 32083 EE bb 32460 FF aa 28920 FF aa 28923 FF aa 28972 FF aa 29382 FF bb 28652 FF bb 28720 FF bb 28864 FF bb 29016 FF bb 29295 FF bb 29488 GG aa 24924 GG aa 25078 GG aa 25223 GG aa 25410 GG bb 24620 GG bb 24629 GG bb 24714 GG bb 25398 HH aa 22040 HH aa 22229 HH aa 22539 HH bb 22056 HH bb 22289 HH bb 22336 HH bb 22664 HH bb 22689 HH bb 22886 II aa 16699 II aa 16953 II bb 16546 II bb 16680 II bb 16908 II bb 16930 II bb 17101 JJ aa 11984 JJ aa 12115 JJ aa 12649 JJ aa 12770 JJ bb 12044 JJ bb 12529 JJ bb 12547 JJ bb 12626} +} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 + AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077 + BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897 + BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104 + CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915 + CC bb 44391 DD aa 39207 DD aa 39796 DD aa 39828 DD bb 39093 + DD bb 39258 DD bb 39336 DD bb 39814 EE aa 31935 EE aa 32599 + EE bb 31944 EE bb 32083 EE bb 32460 FF aa 28920 FF aa 28923 + FF aa 28972 FF aa 29382 FF bb 28652 FF bb 28720 FF bb 28864 + FF bb 29016 FF bb 29295 FF bb 29488 GG aa 24924 GG aa 25078 + GG aa 25223 GG aa 25410 GG bb 24620 GG bb 24629 GG bb 24714 + GG bb 25398 HH aa 22040 HH aa 22229 HH aa 22539 HH bb 22056 + HH bb 22289 HH bb 22336 HH bb 22664 HH bb 22689 HH bb 22886 + II aa 16699 II aa 16953 II bb 16546 II bb 16680 II bb 16908 + II bb 16930 II bb 17101 JJ aa 11984 JJ aa 12115 JJ aa 12649 + JJ aa 12770 JJ bb 12044 JJ bb 12529 JJ bb 12547 JJ bb 12626} do_execsql_test 1.11.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077 BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 41590 BB bb 41638 BB bb 41644 BB bb 41719 BB bb 41725 BB bb 41797 CC aa 39293 CC aa 39445 CC aa 39622 CC aa 39894 CC bb 36357 CC bb 36833 DD aa 31867 DD aa 32456 DD aa 32488 DD bb 29799 DD bb 29964 DD bb 30042 DD bb 30520 EE aa 28813 EE aa 29477 EE bb 27497 EE bb 27636 EE bb 28013 FF aa 24888 FF aa 24891 FF aa 24940 FF aa 25350 FF bb 23730 FF bb 23798 FF bb 23942 FF bb 24094 FF bb 24373 FF bb 24566 GG aa 22385 GG aa 22539 GG aa 22684 GG aa 22871 GG bb 19918 GG bb 19927 GG bb 20012 GG bb 20696 HH aa 16372 HH aa 16561 HH aa 16871 HH bb 14791 HH bb 15024 HH bb 15071 HH bb 15399 HH bb 15424 HH bb 15621 II aa 12231 II aa 12485 II bb 9829 II bb 9963 II bb 10191 II bb 10213 II bb 10384 JJ aa 6541 JJ aa 6672 JJ aa 7206 JJ aa 7327 JJ bb 5551 JJ bb 6036 JJ bb 6054 JJ bb 6133} +} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 + AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077 + BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 41590 + BB bb 41638 BB bb 41644 BB bb 41719 BB bb 41725 BB bb 41797 + CC aa 39293 CC aa 39445 CC aa 39622 CC aa 39894 CC bb 36357 + CC bb 36833 DD aa 31867 DD aa 32456 DD aa 32488 DD bb 29799 + DD bb 29964 DD bb 30042 DD bb 30520 EE aa 28813 EE aa 29477 + EE bb 27497 EE bb 27636 EE bb 28013 FF aa 24888 FF aa 24891 + FF aa 24940 FF aa 25350 FF bb 23730 FF bb 23798 FF bb 23942 + FF bb 24094 FF bb 24373 FF bb 24566 GG aa 22385 GG aa 22539 + GG aa 22684 GG aa 22871 GG bb 19918 GG bb 19927 GG bb 20012 + GG bb 20696 HH aa 16372 HH aa 16561 HH aa 16871 HH bb 14791 + HH bb 15024 HH bb 15071 HH bb 15399 HH bb 15424 HH bb 15621 + II aa 12231 II aa 12485 II bb 9829 II bb 9963 II bb 10191 + II bb 10213 II bb 10384 JJ aa 6541 JJ aa 6672 JJ aa 7206 + JJ aa 7327 JJ bb 5551 JJ bb 6036 JJ bb 6054 JJ bb 6133} do_execsql_test 1.12.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122 CC bb 3122 CC bb 3122 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 4032 DD bb 4032 DD bb 4032 DD bb 4032 EE aa 2539 EE aa 2539 EE bb 2539 EE bb 2539 EE bb 2539 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 4468 GG bb 4468 GG bb 4468 GG bb 4468 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 II aa 3640 II aa 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800} +} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 + BB aa 7340 BB aa 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340 + BB bb 7340 BB bb 7340 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122 + CC bb 3122 CC bb 3122 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 4032 + DD bb 4032 DD bb 4032 DD bb 4032 EE aa 2539 EE aa 2539 EE bb 2539 + EE bb 2539 EE bb 2539 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668 + FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 + GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 4468 GG bb 4468 + GG bb 4468 GG bb 4468 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 5443 + HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 II aa 3640 + II aa 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 + JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800 + JJ bb 3800 JJ bb 3800} do_execsql_test 1.12.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 2378 AA bb 2378 AA bb 2378 AA bb 2378 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467 CC aa 1954 CC aa 1954 CC aa 1954 CC aa 1954 CC bb 1168 CC bb 1168 DD aa 1325 DD aa 1325 DD aa 1325 DD bb 2707 DD bb 2707 DD bb 2707 DD bb 2707 EE aa 890 EE aa 890 EE bb 1649 EE bb 1649 EE bb 1649 FF aa 2163 FF aa 2163 FF aa 2163 FF aa 2163 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 GG aa 1597 GG aa 1597 GG aa 1597 GG aa 1597 GG bb 2871 GG bb 2871 GG bb 2871 GG bb 2871 HH aa 2249 HH aa 2249 HH aa 2249 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 II aa 1050 II aa 1050 II bb 2590 II bb 2590 II bb 2590 II bb 2590 II bb 2590 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ bb 1786 JJ bb 1786 JJ bb 1786 JJ bb 1786} +} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 2378 AA bb 2378 + AA bb 2378 AA bb 2378 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873 + BB aa 2873 BB aa 2873 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467 + BB bb 4467 BB bb 4467 CC aa 1954 CC aa 1954 CC aa 1954 CC aa 1954 + CC bb 1168 CC bb 1168 DD aa 1325 DD aa 1325 DD aa 1325 DD bb 2707 + DD bb 2707 DD bb 2707 DD bb 2707 EE aa 890 EE aa 890 EE bb 1649 + EE bb 1649 EE bb 1649 FF aa 2163 FF aa 2163 FF aa 2163 FF aa 2163 + FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 + GG aa 1597 GG aa 1597 GG aa 1597 GG aa 1597 GG bb 2871 GG bb 2871 + GG bb 2871 GG bb 2871 HH aa 2249 HH aa 2249 HH aa 2249 HH bb 3194 + HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 II aa 1050 + II aa 1050 II bb 2590 II bb 2590 II bb 2590 II bb 2590 II bb 2590 + JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ bb 1786 JJ bb 1786 + JJ bb 1786 JJ bb 1786} do_execsql_test 1.12.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.12.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870 AA bb 870 AA bb 870 BB aa 762 BB aa 762 BB aa 762 BB aa 762 BB aa 762 BB aa 762 BB bb 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840 CC aa 759 CC aa 759 CC aa 759 CC aa 759 CC bb 822 CC bb 822 DD aa 845 DD aa 845 DD aa 845 DD bb 959 DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768 EE bb 768 EE bb 768 FF aa 670 FF aa 670 FF aa 670 FF aa 670 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 GG aa 634 GG aa 634 GG aa 634 GG aa 634 GG bb 938 GG bb 938 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 652 II aa 652 II bb 805 II bb 805 II bb 805 II bb 805 II bb 805 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 JJ bb 839 JJ bb 839} +} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870 + AA bb 870 AA bb 870 BB aa 762 BB aa 762 BB aa 762 BB aa 762 + BB aa 762 BB aa 762 BB bb 840 BB bb 840 BB bb 840 BB bb 840 + BB bb 840 BB bb 840 CC aa 759 CC aa 759 CC aa 759 CC aa 759 + CC bb 822 CC bb 822 DD aa 845 DD aa 845 DD aa 845 DD bb 959 + DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768 + EE bb 768 EE bb 768 FF aa 670 FF aa 670 FF aa 670 FF aa 670 + FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 + GG aa 634 GG aa 634 GG aa 634 GG aa 634 GG bb 938 GG bb 938 + GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 963 + HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 652 + II aa 652 II bb 805 II bb 805 II bb 805 II bb 805 II bb 805 + JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 + JJ bb 839 JJ bb 839} do_execsql_test 1.12.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 309 AA bb 309 AA bb 309 AA bb 309 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB bb 633 BB bb 633 BB bb 633 BB bb 633 BB bb 633 BB bb 633 CC aa 158 CC aa 158 CC aa 158 CC aa 158 CC bb 346 CC bb 346 DD aa 224 DD aa 224 DD aa 224 DD bb 238 DD bb 238 DD bb 238 DD bb 238 EE aa 113 EE aa 113 EE bb 252 EE bb 252 EE bb 252 FF aa 208 FF aa 208 FF aa 208 FF aa 208 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160 GG bb 160 GG bb 160 HH aa 480 HH aa 480 HH aa 480 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 398 II aa 398 II bb 250 II bb 250 II bb 250 II bb 250 II bb 250 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 JJ bb 257 JJ bb 257} +} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 309 AA bb 309 + AA bb 309 AA bb 309 BB aa 247 BB aa 247 BB aa 247 BB aa 247 + BB aa 247 BB aa 247 BB bb 633 BB bb 633 BB bb 633 BB bb 633 + BB bb 633 BB bb 633 CC aa 158 CC aa 158 CC aa 158 CC aa 158 + CC bb 346 CC bb 346 DD aa 224 DD aa 224 DD aa 224 DD bb 238 + DD bb 238 DD bb 238 DD bb 238 EE aa 113 EE aa 113 EE bb 252 + EE bb 252 EE bb 252 FF aa 208 FF aa 208 FF aa 208 FF aa 208 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160 + GG bb 160 GG bb 160 HH aa 480 HH aa 480 HH aa 480 HH bb 133 + HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 398 + II aa 398 II bb 250 II bb 250 II bb 250 II bb 250 II bb 250 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 + JJ bb 257 JJ bb 257} do_execsql_test 1.12.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941 BB aa 6947 BB aa 7093 BB bb 6500 BB bb 6548 BB bb 6554 BB bb 6629 BB bb 6635 BB bb 6707 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964 CC bb 2300 CC bb 2776 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 3073 DD bb 3238 DD bb 3316 DD bb 3794 EE aa 1762 EE aa 2426 EE bb 1771 EE bb 1910 EE bb 2287 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460 FF bb 4730 FF bb 4798 FF bb 4942 FF bb 5094 FF bb 5373 FF bb 5566 GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 3530 GG bb 3539 GG bb 3624 GG bb 4308 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 4480 HH bb 4713 HH bb 4760 HH bb 5088 HH bb 5113 HH bb 5310 II aa 2988 II aa 3242 II bb 2835 II bb 2969 II bb 3197 II bb 3219 II bb 3390 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 JJ bb 3464 JJ bb 3543} +} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941 + BB aa 6947 BB aa 7093 BB bb 6500 BB bb 6548 BB bb 6554 BB bb 6629 + BB bb 6635 BB bb 6707 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964 + CC bb 2300 CC bb 2776 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 3073 + DD bb 3238 DD bb 3316 DD bb 3794 EE aa 1762 EE aa 2426 EE bb 1771 + EE bb 1910 EE bb 2287 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460 + FF bb 4730 FF bb 4798 FF bb 4942 FF bb 5094 FF bb 5373 FF bb 5566 + GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 3530 GG bb 3539 + GG bb 3624 GG bb 4308 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 4480 + HH bb 4713 HH bb 4760 HH bb 5088 HH bb 5113 HH bb 5310 II aa 2988 + II aa 3242 II bb 2835 II bb 2969 II bb 3197 II bb 3219 II bb 3390 + JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 + JJ bb 3464 JJ bb 3543} do_execsql_test 1.12.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 1508 AA bb 1751 AA bb 1806 AA bb 2069 BB aa 2111 BB aa 2213 BB aa 2461 BB aa 2474 BB aa 2480 BB aa 2626 BB bb 3627 BB bb 3675 BB bb 3681 BB bb 3756 BB bb 3762 BB bb 3834 CC aa 1195 CC aa 1347 CC aa 1524 CC aa 1796 CC bb 346 CC bb 822 DD aa 480 DD aa 1069 DD aa 1101 DD bb 1748 DD bb 1913 DD bb 1991 DD bb 2469 EE aa 113 EE aa 777 EE bb 881 EE bb 1020 EE bb 1397 FF aa 1493 FF aa 1496 FF aa 1545 FF aa 1955 FF bb 2567 FF bb 2635 FF bb 2779 FF bb 2931 FF bb 3210 FF bb 3403 GG aa 963 GG aa 1117 GG aa 1262 GG aa 1449 GG bb 1933 GG bb 1942 GG bb 2027 GG bb 2711 HH aa 1270 HH aa 1459 HH aa 1769 HH bb 2231 HH bb 2464 HH bb 2511 HH bb 2839 HH bb 2864 HH bb 3061 II aa 398 II aa 652 II bb 1785 II bb 1919 II bb 2147 II bb 2169 II bb 2340 JJ aa 1115 JJ aa 1246 JJ aa 1780 JJ aa 1901 JJ bb 947 JJ bb 1432 JJ bb 1450 JJ bb 1529} +} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 1508 AA bb 1751 + AA bb 1806 AA bb 2069 BB aa 2111 BB aa 2213 BB aa 2461 BB aa 2474 + BB aa 2480 BB aa 2626 BB bb 3627 BB bb 3675 BB bb 3681 BB bb 3756 + BB bb 3762 BB bb 3834 CC aa 1195 CC aa 1347 CC aa 1524 CC aa 1796 + CC bb 346 CC bb 822 DD aa 480 DD aa 1069 DD aa 1101 DD bb 1748 + DD bb 1913 DD bb 1991 DD bb 2469 EE aa 113 EE aa 777 EE bb 881 + EE bb 1020 EE bb 1397 FF aa 1493 FF aa 1496 FF aa 1545 FF aa 1955 + FF bb 2567 FF bb 2635 FF bb 2779 FF bb 2931 FF bb 3210 FF bb 3403 + GG aa 963 GG aa 1117 GG aa 1262 GG aa 1449 GG bb 1933 GG bb 1942 + GG bb 2027 GG bb 2711 HH aa 1270 HH aa 1459 HH aa 1769 HH bb 2231 + HH bb 2464 HH bb 2511 HH bb 2839 HH bb 2864 HH bb 3061 II aa 398 + II aa 652 II bb 1785 II bb 1919 II bb 2147 II bb 2169 II bb 2340 + JJ aa 1115 JJ aa 1246 JJ aa 1780 JJ aa 1901 JJ bb 947 JJ bb 1432 + JJ bb 1450 JJ bb 1529} do_execsql_test 1.13.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 12025 AA aa 12025 AA aa 12025 AA aa 12025 AA bb 12025 AA bb 12025 AA bb 12025 AA bb 12025 BB aa 10462 BB aa 10462 BB aa 10462 BB aa 10462 BB aa 10462 BB aa 10462 BB bb 10462 BB bb 10462 BB bb 10462 BB bb 10462 BB bb 10462 BB bb 10462 CC aa 7154 CC aa 7154 CC aa 7154 CC aa 7154 CC bb 7154 CC bb 7154 DD aa 6571 DD aa 6571 DD aa 6571 DD bb 6571 DD bb 6571 DD bb 6571 DD bb 6571 EE aa 8207 EE aa 8207 EE bb 8207 EE bb 8207 EE bb 8207 FF aa 10136 FF aa 10136 FF aa 10136 FF aa 10136 FF bb 10136 FF bb 10136 FF bb 10136 FF bb 10136 FF bb 10136 FF bb 10136 GG aa 9911 GG aa 9911 GG aa 9911 GG aa 9911 GG bb 9911 GG bb 9911 GG bb 9911 GG bb 9911 HH aa 9083 HH aa 9083 HH aa 9083 HH bb 9083 HH bb 9083 HH bb 9083 HH bb 9083 HH bb 9083 HH bb 9083 II aa 7440 II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800} +} {AA aa 12025 AA aa 12025 AA aa 12025 AA aa 12025 AA bb 12025 + AA bb 12025 AA bb 12025 AA bb 12025 BB aa 10462 BB aa 10462 + BB aa 10462 BB aa 10462 BB aa 10462 BB aa 10462 BB bb 10462 + BB bb 10462 BB bb 10462 BB bb 10462 BB bb 10462 BB bb 10462 + CC aa 7154 CC aa 7154 CC aa 7154 CC aa 7154 CC bb 7154 CC bb 7154 + DD aa 6571 DD aa 6571 DD aa 6571 DD bb 6571 DD bb 6571 DD bb 6571 + DD bb 6571 EE aa 8207 EE aa 8207 EE bb 8207 EE bb 8207 EE bb 8207 + FF aa 10136 FF aa 10136 FF aa 10136 FF aa 10136 FF bb 10136 + FF bb 10136 FF bb 10136 FF bb 10136 FF bb 10136 FF bb 10136 + GG aa 9911 GG aa 9911 GG aa 9911 GG aa 9911 GG bb 9911 GG bb 9911 + GG bb 9911 GG bb 9911 HH aa 9083 HH aa 9083 HH aa 9083 HH bb 9083 + HH bb 9083 HH bb 9083 HH bb 9083 HH bb 9083 HH bb 9083 II aa 7440 + II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 + JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800 + JJ bb 3800 JJ bb 3800} do_execsql_test 1.13.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 5251 AA bb 5251 AA bb 5251 AA bb 5251 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB bb 6421 BB bb 6421 BB bb 6421 BB bb 6421 BB bb 6421 BB bb 6421 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122 CC bb 2493 CC bb 2493 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 3597 DD bb 3597 DD bb 3597 DD bb 3597 EE aa 2539 EE aa 2539 EE bb 3812 EE bb 3812 EE bb 3812 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668 FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102 GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 5120 GG bb 5120 GG bb 5120 GG bb 5120 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 4244 HH bb 4244 HH bb 4244 HH bb 4244 HH bb 4244 HH bb 4244 II aa 3640 II aa 3640 II bb 4604 II bb 4604 II bb 4604 II bb 4604 II bb 4604 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786 JJ bb 1786 JJ bb 1786 JJ bb 1786} +} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 5251 AA bb 5251 + AA bb 5251 AA bb 5251 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 + BB aa 7340 BB aa 7340 BB bb 6421 BB bb 6421 BB bb 6421 BB bb 6421 + BB bb 6421 BB bb 6421 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122 + CC bb 2493 CC bb 2493 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 3597 + DD bb 3597 DD bb 3597 DD bb 3597 EE aa 2539 EE aa 2539 EE bb 3812 + EE bb 3812 EE bb 3812 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668 + FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102 + GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 5120 GG bb 5120 + GG bb 5120 GG bb 5120 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 4244 + HH bb 4244 HH bb 4244 HH bb 4244 HH bb 4244 HH bb 4244 II aa 3640 + II aa 3640 II bb 4604 II bb 4604 II bb 4604 II bb 4604 II bb 4604 + JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786 JJ bb 1786 + JJ bb 1786 JJ bb 1786} do_execsql_test 1.13.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.13.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870 AA bb 870 AA bb 870 BB aa 840 BB aa 840 BB aa 840 BB aa 840 BB aa 840 BB aa 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840 CC aa 822 CC aa 822 CC aa 822 CC aa 822 CC bb 845 CC bb 845 DD aa 959 DD aa 959 DD aa 959 DD bb 959 DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768 EE bb 768 EE bb 768 FF aa 938 FF aa 938 FF aa 938 FF aa 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 979 GG bb 979 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 805 II aa 805 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 JJ bb 839 JJ bb 839} +} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870 + AA bb 870 AA bb 870 BB aa 840 BB aa 840 BB aa 840 BB aa 840 + BB aa 840 BB aa 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840 + BB bb 840 BB bb 840 CC aa 822 CC aa 822 CC aa 822 CC aa 822 + CC bb 845 CC bb 845 DD aa 959 DD aa 959 DD aa 959 DD bb 959 + DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768 + EE bb 768 EE bb 768 FF aa 938 FF aa 938 FF aa 938 FF aa 938 + FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 + GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 979 GG bb 979 + GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963 + HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 805 + II aa 805 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 + JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 + JJ bb 839 JJ bb 839} do_execsql_test 1.13.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 247 AA bb 247 AA bb 247 AA bb 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB bb 158 BB bb 158 BB bb 158 BB bb 158 BB bb 158 BB bb 158 CC aa 158 CC aa 158 CC aa 158 CC aa 158 CC bb 224 CC bb 224 DD aa 224 DD aa 224 DD aa 224 DD bb 113 DD bb 113 DD bb 113 DD bb 113 EE aa 113 EE aa 113 EE bb 208 EE bb 208 EE bb 208 FF aa 102 FF aa 102 FF aa 102 FF aa 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160 GG bb 160 GG bb 160 HH aa 133 HH aa 133 HH aa 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 250 II aa 250 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 JJ bb 257 JJ bb 257} +} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 247 AA bb 247 + AA bb 247 AA bb 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247 + BB aa 247 BB aa 247 BB bb 158 BB bb 158 BB bb 158 BB bb 158 + BB bb 158 BB bb 158 CC aa 158 CC aa 158 CC aa 158 CC aa 158 + CC bb 224 CC bb 224 DD aa 224 DD aa 224 DD aa 224 DD bb 113 + DD bb 113 DD bb 113 DD bb 113 EE aa 113 EE aa 113 EE bb 208 + EE bb 208 EE bb 208 FF aa 102 FF aa 102 FF aa 102 FF aa 102 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160 + GG bb 160 GG bb 160 HH aa 133 HH aa 133 HH aa 133 HH bb 133 + HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 250 + II aa 250 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 + JJ bb 257 JJ bb 257} do_execsql_test 1.13.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 11091 AA aa 11114 AA aa 11786 AA aa 11802 AA bb 11155 AA bb 11398 AA bb 11453 AA bb 11716 BB aa 9700 BB aa 9802 BB aa 10050 BB aa 10063 BB aa 10069 BB aa 10215 BB bb 9622 BB bb 9670 BB bb 9676 BB bb 9751 BB bb 9757 BB bb 9829 CC aa 6395 CC aa 6547 CC aa 6724 CC aa 6996 CC bb 6332 CC bb 6808 DD aa 5726 DD aa 6315 DD aa 6347 DD bb 5612 DD bb 5777 DD bb 5855 DD bb 6333 EE aa 7430 EE aa 8094 EE bb 7439 EE bb 7578 EE bb 7955 FF aa 9466 FF aa 9469 FF aa 9518 FF aa 9928 FF bb 9198 FF bb 9266 FF bb 9410 FF bb 9562 FF bb 9841 FF bb 10034 GG aa 9277 GG aa 9431 GG aa 9576 GG aa 9763 GG bb 8973 GG bb 8982 GG bb 9067 GG bb 9751 HH aa 8104 HH aa 8293 HH aa 8603 HH bb 8120 HH bb 8353 HH bb 8400 HH bb 8728 HH bb 8753 HH bb 8950 II aa 6788 II aa 7042 II bb 6635 II bb 6769 II bb 6997 II bb 7019 II bb 7190 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 JJ bb 3464 JJ bb 3543} +} {AA aa 11091 AA aa 11114 AA aa 11786 AA aa 11802 AA bb 11155 + AA bb 11398 AA bb 11453 AA bb 11716 BB aa 9700 BB aa 9802 + BB aa 10050 BB aa 10063 BB aa 10069 BB aa 10215 BB bb 9622 + BB bb 9670 BB bb 9676 BB bb 9751 BB bb 9757 BB bb 9829 CC aa 6395 + CC aa 6547 CC aa 6724 CC aa 6996 CC bb 6332 CC bb 6808 DD aa 5726 + DD aa 6315 DD aa 6347 DD bb 5612 DD bb 5777 DD bb 5855 DD bb 6333 + EE aa 7430 EE aa 8094 EE bb 7439 EE bb 7578 EE bb 7955 FF aa 9466 + FF aa 9469 FF aa 9518 FF aa 9928 FF bb 9198 FF bb 9266 FF bb 9410 + FF bb 9562 FF bb 9841 FF bb 10034 GG aa 9277 GG aa 9431 + GG aa 9576 GG aa 9763 GG bb 8973 GG bb 8982 GG bb 9067 GG bb 9751 + HH aa 8104 HH aa 8293 HH aa 8603 HH bb 8120 HH bb 8353 HH bb 8400 + HH bb 8728 HH bb 8753 HH bb 8950 II aa 6788 II aa 7042 II bb 6635 + II bb 6769 II bb 6997 II bb 7019 II bb 7190 JJ aa 2901 JJ aa 3032 + JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 JJ bb 3464 JJ bb 3543} do_execsql_test 1.13.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 4381 AA bb 4624 AA bb 4679 AA bb 4942 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941 BB aa 6947 BB aa 7093 BB bb 5581 BB bb 5629 BB bb 5635 BB bb 5710 BB bb 5716 BB bb 5788 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964 CC bb 1671 CC bb 2147 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 2638 DD bb 2803 DD bb 2881 DD bb 3359 EE aa 1762 EE aa 2426 EE bb 3044 EE bb 3183 EE bb 3560 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460 FF bb 4164 FF bb 4232 FF bb 4376 FF bb 4528 FF bb 4807 FF bb 5000 GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 4182 GG bb 4191 GG bb 4276 GG bb 4960 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 3281 HH bb 3514 HH bb 3561 HH bb 3889 HH bb 3914 HH bb 4111 II aa 2988 II aa 3242 II bb 3799 II bb 3933 II bb 4161 II bb 4183 II bb 4354 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947 JJ bb 1432 JJ bb 1450 JJ bb 1529} +} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 4381 AA bb 4624 + AA bb 4679 AA bb 4942 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941 + BB aa 6947 BB aa 7093 BB bb 5581 BB bb 5629 BB bb 5635 BB bb 5710 + BB bb 5716 BB bb 5788 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964 + CC bb 1671 CC bb 2147 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 2638 + DD bb 2803 DD bb 2881 DD bb 3359 EE aa 1762 EE aa 2426 EE bb 3044 + EE bb 3183 EE bb 3560 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460 + FF bb 4164 FF bb 4232 FF bb 4376 FF bb 4528 FF bb 4807 FF bb 5000 + GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 4182 GG bb 4191 + GG bb 4276 GG bb 4960 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 3281 + HH bb 3514 HH bb 3561 HH bb 3889 HH bb 3914 HH bb 4111 II aa 2988 + II aa 3242 II bb 3799 II bb 3933 II bb 4161 II bb 4183 II bb 4354 + JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947 JJ bb 1432 + JJ bb 1450 JJ bb 1529} do_execsql_test 1.14.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 32712 CC bb 32712 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 29590 DD bb 29590 DD bb 29590 DD bb 29590 EE aa 25558 EE aa 25558 EE bb 25558 EE bb 25558 EE bb 25558 FF aa 23019 FF aa 23019 FF aa 23019 FF aa 23019 FF bb 23019 FF bb 23019 FF bb 23019 FF bb 23019 FF bb 23019 FF bb 23019 GG aa 17351 GG aa 17351 GG aa 17351 GG aa 17351 GG bb 17351 GG bb 17351 GG bb 17351 GG bb 17351 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 II aa 7440 II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800} +} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 + AA bb 44737 AA bb 44737 AA bb 44737 BB aa 40052 BB aa 40052 + BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 40052 + BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 + CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 32712 + CC bb 32712 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 29590 + DD bb 29590 DD bb 29590 DD bb 29590 EE aa 25558 EE aa 25558 + EE bb 25558 EE bb 25558 EE bb 25558 FF aa 23019 FF aa 23019 + FF aa 23019 FF aa 23019 FF bb 23019 FF bb 23019 FF bb 23019 + FF bb 23019 FF bb 23019 FF bb 23019 GG aa 17351 GG aa 17351 + GG aa 17351 GG aa 17351 GG bb 17351 GG bb 17351 GG bb 17351 + GG bb 17351 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 12883 + HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 + II aa 7440 II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 + II bb 7440 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 + JJ bb 3800 JJ bb 3800 JJ bb 3800} do_execsql_test 1.14.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 42430 AA bb 42430 AA bb 42430 AA bb 42430 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 30758 CC bb 30758 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 28265 DD bb 28265 DD bb 28265 DD bb 28265 EE aa 25558 EE aa 25558 EE bb 24668 EE bb 24668 EE bb 24668 FF aa 23019 FF aa 23019 FF aa 23019 FF aa 23019 FF bb 20856 FF bb 20856 FF bb 20856 FF bb 20856 FF bb 20856 FF bb 20856 GG aa 17351 GG aa 17351 GG aa 17351 GG aa 17351 GG bb 15754 GG bb 15754 GG bb 15754 GG bb 15754 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 II aa 7440 II aa 7440 II bb 6390 II bb 6390 II bb 6390 II bb 6390 II bb 6390 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786 JJ bb 1786 JJ bb 1786 JJ bb 1786} +} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 42430 + AA bb 42430 AA bb 42430 AA bb 42430 BB aa 40052 BB aa 40052 + BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 37179 + BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 + CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 30758 + CC bb 30758 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 28265 + DD bb 28265 DD bb 28265 DD bb 28265 EE aa 25558 EE aa 25558 + EE bb 24668 EE bb 24668 EE bb 24668 FF aa 23019 FF aa 23019 + FF aa 23019 FF aa 23019 FF bb 20856 FF bb 20856 FF bb 20856 + FF bb 20856 FF bb 20856 FF bb 20856 GG aa 17351 GG aa 17351 + GG aa 17351 GG aa 17351 GG bb 15754 GG bb 15754 GG bb 15754 + GG bb 15754 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 10634 + HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 + II aa 7440 II aa 7440 II bb 6390 II bb 6390 II bb 6390 II bb 6390 + II bb 6390 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786 + JJ bb 1786 JJ bb 1786 JJ bb 1786} do_execsql_test 1.14.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.14.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 899 II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 JJ bb 839 JJ bb 839} +} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 + AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 + BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 + BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 + CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 + DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 + EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 + FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 + GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 + GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963 + HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 899 + II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 + JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 + JJ bb 839 JJ bb 839} do_execsql_test 1.14.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113 GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 JJ bb 257 JJ bb 257} +} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 + AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 + BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 + BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 + CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 + DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 + EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113 + GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113 + HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 + II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 + JJ bb 257 JJ bb 257} do_execsql_test 1.14.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 39290 BB aa 39392 BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 39212 BB bb 39260 BB bb 39266 BB bb 39341 BB bb 39347 BB bb 39419 CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 31890 CC bb 32366 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 28631 DD bb 28796 DD bb 28874 DD bb 29352 EE aa 24781 EE aa 25445 EE bb 24790 EE bb 24929 EE bb 25306 FF aa 22349 FF aa 22352 FF aa 22401 FF aa 22811 FF bb 22081 FF bb 22149 FF bb 22293 FF bb 22445 FF bb 22724 FF bb 22917 GG aa 16717 GG aa 16871 GG aa 17016 GG aa 17203 GG bb 16413 GG bb 16422 GG bb 16507 GG bb 17191 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 11920 HH bb 12153 HH bb 12200 HH bb 12528 HH bb 12553 HH bb 12750 II aa 6788 II aa 7042 II bb 6635 II bb 6769 II bb 6997 II bb 7019 II bb 7190 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 JJ bb 3464 JJ bb 3543} +} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 + AA bb 44110 AA bb 44165 AA bb 44428 BB aa 39290 BB aa 39392 + BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 39212 + BB bb 39260 BB bb 39266 BB bb 39341 BB bb 39347 BB bb 39419 + CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 31890 + CC bb 32366 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 28631 + DD bb 28796 DD bb 28874 DD bb 29352 EE aa 24781 EE aa 25445 + EE bb 24790 EE bb 24929 EE bb 25306 FF aa 22349 FF aa 22352 + FF aa 22401 FF aa 22811 FF bb 22081 FF bb 22149 FF bb 22293 + FF bb 22445 FF bb 22724 FF bb 22917 GG aa 16717 GG aa 16871 + GG aa 17016 GG aa 17203 GG bb 16413 GG bb 16422 GG bb 16507 + GG bb 17191 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 11920 + HH bb 12153 HH bb 12200 HH bb 12528 HH bb 12553 HH bb 12750 + II aa 6788 II aa 7042 II bb 6635 II bb 6769 II bb 6997 II bb 7019 + II bb 7190 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 + JJ bb 3446 JJ bb 3464 JJ bb 3543} do_execsql_test 1.14.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 41560 AA bb 41803 AA bb 41858 AA bb 42121 BB aa 39290 BB aa 39392 BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 36339 BB bb 36387 BB bb 36393 BB bb 36468 BB bb 36474 BB bb 36546 CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 29936 CC bb 30412 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 27306 DD bb 27471 DD bb 27549 DD bb 28027 EE aa 24781 EE aa 25445 EE bb 23900 EE bb 24039 EE bb 24416 FF aa 22349 FF aa 22352 FF aa 22401 FF aa 22811 FF bb 19918 FF bb 19986 FF bb 20130 FF bb 20282 FF bb 20561 FF bb 20754 GG aa 16717 GG aa 16871 GG aa 17016 GG aa 17203 GG bb 14816 GG bb 14825 GG bb 14910 GG bb 15594 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 9671 HH bb 9904 HH bb 9951 HH bb 10279 HH bb 10304 HH bb 10501 II aa 6788 II aa 7042 II bb 5585 II bb 5719 II bb 5947 II bb 5969 II bb 6140 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947 JJ bb 1432 JJ bb 1450 JJ bb 1529} +} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 41560 + AA bb 41803 AA bb 41858 AA bb 42121 BB aa 39290 BB aa 39392 + BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 36339 + BB bb 36387 BB bb 36393 BB bb 36468 BB bb 36474 BB bb 36546 + CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 29936 + CC bb 30412 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 27306 + DD bb 27471 DD bb 27549 DD bb 28027 EE aa 24781 EE aa 25445 + EE bb 23900 EE bb 24039 EE bb 24416 FF aa 22349 FF aa 22352 + FF aa 22401 FF aa 22811 FF bb 19918 FF bb 19986 FF bb 20130 + FF bb 20282 FF bb 20561 FF bb 20754 GG aa 16717 GG aa 16871 + GG aa 17016 GG aa 17203 GG bb 14816 GG bb 14825 GG bb 14910 + GG bb 15594 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 9671 + HH bb 9904 HH bb 9951 HH bb 10279 HH bb 10304 HH bb 10501 + II aa 6788 II aa 7042 II bb 5585 II bb 5719 II bb 5947 II bb 5969 + II bb 6140 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947 + JJ bb 1432 JJ bb 1450 JJ bb 1529} do_execsql_test 1.15.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 32712 CC bb 32712 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 29590 DD bb 29590 DD bb 29590 DD bb 29590 EE aa 25558 EE aa 25558 EE bb 25558 EE bb 25558 EE bb 25558 FF aa 23019 FF aa 23019 FF aa 23019 FF aa 23019 FF bb 23019 FF bb 23019 FF bb 23019 FF bb 23019 FF bb 23019 FF bb 23019 GG aa 17351 GG aa 17351 GG aa 17351 GG aa 17351 GG bb 17351 GG bb 17351 GG bb 17351 GG bb 17351 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 II aa 7440 II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800} +} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737 + AA bb 44737 AA bb 44737 AA bb 44737 BB aa 40052 BB aa 40052 + BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 40052 + BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 + CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 32712 + CC bb 32712 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 29590 + DD bb 29590 DD bb 29590 DD bb 29590 EE aa 25558 EE aa 25558 + EE bb 25558 EE bb 25558 EE bb 25558 FF aa 23019 FF aa 23019 + FF aa 23019 FF aa 23019 FF bb 23019 FF bb 23019 FF bb 23019 + FF bb 23019 FF bb 23019 FF bb 23019 GG aa 17351 GG aa 17351 + GG aa 17351 GG aa 17351 GG bb 17351 GG bb 17351 GG bb 17351 + GG bb 17351 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 12883 + HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 + II aa 7440 II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 + II bb 7440 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 + JJ bb 3800 JJ bb 3800 JJ bb 3800} do_execsql_test 1.15.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 42430 AA bb 42430 AA bb 42430 AA bb 42430 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 30758 CC bb 30758 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 28265 DD bb 28265 DD bb 28265 DD bb 28265 EE aa 25558 EE aa 25558 EE bb 24668 EE bb 24668 EE bb 24668 FF aa 23019 FF aa 23019 FF aa 23019 FF aa 23019 FF bb 20856 FF bb 20856 FF bb 20856 FF bb 20856 FF bb 20856 FF bb 20856 GG aa 17351 GG aa 17351 GG aa 17351 GG aa 17351 GG bb 15754 GG bb 15754 GG bb 15754 GG bb 15754 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 II aa 7440 II aa 7440 II bb 6390 II bb 6390 II bb 6390 II bb 6390 II bb 6390 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786 JJ bb 1786 JJ bb 1786 JJ bb 1786} +} {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 42430 + AA bb 42430 AA bb 42430 AA bb 42430 BB aa 40052 BB aa 40052 + BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 37179 + BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 + CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 30758 + CC bb 30758 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 28265 + DD bb 28265 DD bb 28265 DD bb 28265 EE aa 25558 EE aa 25558 + EE bb 24668 EE bb 24668 EE bb 24668 FF aa 23019 FF aa 23019 + FF aa 23019 FF aa 23019 FF bb 20856 FF bb 20856 FF bb 20856 + FF bb 20856 FF bb 20856 FF bb 20856 GG aa 17351 GG aa 17351 + GG aa 17351 GG aa 17351 GG bb 15754 GG bb 15754 GG bb 15754 + GG bb 15754 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 10634 + HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 + II aa 7440 II aa 7440 II bb 6390 II bb 6390 II bb 6390 II bb 6390 + II bb 6390 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786 + JJ bb 1786 JJ bb 1786 JJ bb 1786} do_execsql_test 1.15.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.15.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 899 II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 JJ bb 839 JJ bb 839} +} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 + AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 + BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 + BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 + CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 + DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 + EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 + FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 + GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 + GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963 + HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 899 + II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 + JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 + JJ bb 839 JJ bb 839} do_execsql_test 1.15.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113 GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 JJ bb 257 JJ bb 257} +} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 + AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 + BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 + BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 + CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 + DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 + EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113 + GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113 + HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 + II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 + JJ bb 257 JJ bb 257} do_execsql_test 1.15.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 39290 BB aa 39392 BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 39212 BB bb 39260 BB bb 39266 BB bb 39341 BB bb 39347 BB bb 39419 CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 31890 CC bb 32366 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 28631 DD bb 28796 DD bb 28874 DD bb 29352 EE aa 24781 EE aa 25445 EE bb 24790 EE bb 24929 EE bb 25306 FF aa 22349 FF aa 22352 FF aa 22401 FF aa 22811 FF bb 22081 FF bb 22149 FF bb 22293 FF bb 22445 FF bb 22724 FF bb 22917 GG aa 16717 GG aa 16871 GG aa 17016 GG aa 17203 GG bb 16413 GG bb 16422 GG bb 16507 GG bb 17191 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 11920 HH bb 12153 HH bb 12200 HH bb 12528 HH bb 12553 HH bb 12750 II aa 6788 II aa 7042 II bb 6635 II bb 6769 II bb 6997 II bb 7019 II bb 7190 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 JJ bb 3464 JJ bb 3543} +} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867 + AA bb 44110 AA bb 44165 AA bb 44428 BB aa 39290 BB aa 39392 + BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 39212 + BB bb 39260 BB bb 39266 BB bb 39341 BB bb 39347 BB bb 39419 + CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 31890 + CC bb 32366 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 28631 + DD bb 28796 DD bb 28874 DD bb 29352 EE aa 24781 EE aa 25445 + EE bb 24790 EE bb 24929 EE bb 25306 FF aa 22349 FF aa 22352 + FF aa 22401 FF aa 22811 FF bb 22081 FF bb 22149 FF bb 22293 + FF bb 22445 FF bb 22724 FF bb 22917 GG aa 16717 GG aa 16871 + GG aa 17016 GG aa 17203 GG bb 16413 GG bb 16422 GG bb 16507 + GG bb 17191 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 11920 + HH bb 12153 HH bb 12200 HH bb 12528 HH bb 12553 HH bb 12750 + II aa 6788 II aa 7042 II bb 6635 II bb 6769 II bb 6997 II bb 7019 + II bb 7190 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 + JJ bb 3446 JJ bb 3464 JJ bb 3543} do_execsql_test 1.15.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 41560 AA bb 41803 AA bb 41858 AA bb 42121 BB aa 39290 BB aa 39392 BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 36339 BB bb 36387 BB bb 36393 BB bb 36468 BB bb 36474 BB bb 36546 CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 29936 CC bb 30412 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 27306 DD bb 27471 DD bb 27549 DD bb 28027 EE aa 24781 EE aa 25445 EE bb 23900 EE bb 24039 EE bb 24416 FF aa 22349 FF aa 22352 FF aa 22401 FF aa 22811 FF bb 19918 FF bb 19986 FF bb 20130 FF bb 20282 FF bb 20561 FF bb 20754 GG aa 16717 GG aa 16871 GG aa 17016 GG aa 17203 GG bb 14816 GG bb 14825 GG bb 14910 GG bb 15594 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 9671 HH bb 9904 HH bb 9951 HH bb 10279 HH bb 10304 HH bb 10501 II aa 6788 II aa 7042 II bb 5585 II bb 5719 II bb 5947 II bb 5969 II bb 6140 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947 JJ bb 1432 JJ bb 1450 JJ bb 1529} +} {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 41560 + AA bb 41803 AA bb 41858 AA bb 42121 BB aa 39290 BB aa 39392 + BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 36339 + BB bb 36387 BB bb 36393 BB bb 36468 BB bb 36474 BB bb 36546 + CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 29936 + CC bb 30412 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 27306 + DD bb 27471 DD bb 27549 DD bb 28027 EE aa 24781 EE aa 25445 + EE bb 23900 EE bb 24039 EE bb 24416 FF aa 22349 FF aa 22352 + FF aa 22401 FF aa 22811 FF bb 19918 FF bb 19986 FF bb 20130 + FF bb 20282 FF bb 20561 FF bb 20754 GG aa 16717 GG aa 16871 + GG aa 17016 GG aa 17203 GG bb 14816 GG bb 14825 GG bb 14910 + GG bb 15594 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 9671 + HH bb 9904 HH bb 9951 HH bb 10279 HH bb 10304 HH bb 10501 + II aa 6788 II aa 7042 II bb 5585 II bb 5719 II bb 5947 II bb 5969 + II bb 6140 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947 + JJ bb 1432 JJ bb 1450 JJ bb 1529} do_execsql_test 1.16.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 AA bb 4685 AA bb 4685 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122 CC bb 3122 CC bb 3122 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 4032 DD bb 4032 DD bb 4032 DD bb 4032 EE aa 2539 EE aa 2539 EE bb 2539 EE bb 2539 EE bb 2539 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 4468 GG bb 4468 GG bb 4468 GG bb 4468 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 II aa 3640 II aa 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800 JJ bb 3800} +} {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685 + AA bb 4685 AA bb 4685 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340 + BB aa 7340 BB aa 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340 + BB bb 7340 BB bb 7340 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122 + CC bb 3122 CC bb 3122 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 4032 + DD bb 4032 DD bb 4032 DD bb 4032 EE aa 2539 EE aa 2539 EE bb 2539 + EE bb 2539 EE bb 2539 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668 + FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 + GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 4468 GG bb 4468 + GG bb 4468 GG bb 4468 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 5443 + HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 II aa 3640 + II aa 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 + JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800 + JJ bb 3800 JJ bb 3800} do_execsql_test 1.16.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 2378 AA bb 2378 AA bb 2378 AA bb 2378 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467 CC aa 1954 CC aa 1954 CC aa 1954 CC aa 1954 CC bb 1168 CC bb 1168 DD aa 1325 DD aa 1325 DD aa 1325 DD bb 2707 DD bb 2707 DD bb 2707 DD bb 2707 EE aa 890 EE aa 890 EE bb 1649 EE bb 1649 EE bb 1649 FF aa 2163 FF aa 2163 FF aa 2163 FF aa 2163 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 GG aa 1597 GG aa 1597 GG aa 1597 GG aa 1597 GG bb 2871 GG bb 2871 GG bb 2871 GG bb 2871 HH aa 2249 HH aa 2249 HH aa 2249 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 II aa 1050 II aa 1050 II bb 2590 II bb 2590 II bb 2590 II bb 2590 II bb 2590 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ bb 1786 JJ bb 1786 JJ bb 1786 JJ bb 1786} +} {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 2378 AA bb 2378 + AA bb 2378 AA bb 2378 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873 + BB aa 2873 BB aa 2873 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467 + BB bb 4467 BB bb 4467 CC aa 1954 CC aa 1954 CC aa 1954 CC aa 1954 + CC bb 1168 CC bb 1168 DD aa 1325 DD aa 1325 DD aa 1325 DD bb 2707 + DD bb 2707 DD bb 2707 DD bb 2707 EE aa 890 EE aa 890 EE bb 1649 + EE bb 1649 EE bb 1649 FF aa 2163 FF aa 2163 FF aa 2163 FF aa 2163 + FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 + GG aa 1597 GG aa 1597 GG aa 1597 GG aa 1597 GG bb 2871 GG bb 2871 + GG bb 2871 GG bb 2871 HH aa 2249 HH aa 2249 HH aa 2249 HH bb 3194 + HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 II aa 1050 + II aa 1050 II bb 2590 II bb 2590 II bb 2590 II bb 2590 II bb 2590 + JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ bb 1786 JJ bb 1786 + JJ bb 1786 JJ bb 1786} do_execsql_test 1.16.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.16.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870 AA bb 870 AA bb 870 BB aa 762 BB aa 762 BB aa 762 BB aa 762 BB aa 762 BB aa 762 BB bb 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840 CC aa 759 CC aa 759 CC aa 759 CC aa 759 CC bb 822 CC bb 822 DD aa 845 DD aa 845 DD aa 845 DD bb 959 DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768 EE bb 768 EE bb 768 FF aa 670 FF aa 670 FF aa 670 FF aa 670 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 GG aa 634 GG aa 634 GG aa 634 GG aa 634 GG bb 938 GG bb 938 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 652 II aa 652 II bb 805 II bb 805 II bb 805 II bb 805 II bb 805 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 JJ bb 839 JJ bb 839} +} {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870 + AA bb 870 AA bb 870 BB aa 762 BB aa 762 BB aa 762 BB aa 762 + BB aa 762 BB aa 762 BB bb 840 BB bb 840 BB bb 840 BB bb 840 + BB bb 840 BB bb 840 CC aa 759 CC aa 759 CC aa 759 CC aa 759 + CC bb 822 CC bb 822 DD aa 845 DD aa 845 DD aa 845 DD bb 959 + DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768 + EE bb 768 EE bb 768 FF aa 670 FF aa 670 FF aa 670 FF aa 670 + FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 + GG aa 634 GG aa 634 GG aa 634 GG aa 634 GG bb 938 GG bb 938 + GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 963 + HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 652 + II aa 652 II bb 805 II bb 805 II bb 805 II bb 805 II bb 805 + JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839 + JJ bb 839 JJ bb 839} do_execsql_test 1.16.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 309 AA bb 309 AA bb 309 AA bb 309 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247 BB bb 633 BB bb 633 BB bb 633 BB bb 633 BB bb 633 BB bb 633 CC aa 158 CC aa 158 CC aa 158 CC aa 158 CC bb 346 CC bb 346 DD aa 224 DD aa 224 DD aa 224 DD bb 238 DD bb 238 DD bb 238 DD bb 238 EE aa 113 EE aa 113 EE bb 252 EE bb 252 EE bb 252 FF aa 208 FF aa 208 FF aa 208 FF aa 208 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160 GG bb 160 GG bb 160 HH aa 480 HH aa 480 HH aa 480 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 398 II aa 398 II bb 250 II bb 250 II bb 250 II bb 250 II bb 250 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 JJ bb 257 JJ bb 257} +} {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 309 AA bb 309 + AA bb 309 AA bb 309 BB aa 247 BB aa 247 BB aa 247 BB aa 247 + BB aa 247 BB aa 247 BB bb 633 BB bb 633 BB bb 633 BB bb 633 + BB bb 633 BB bb 633 CC aa 158 CC aa 158 CC aa 158 CC aa 158 + CC bb 346 CC bb 346 DD aa 224 DD aa 224 DD aa 224 DD bb 238 + DD bb 238 DD bb 238 DD bb 238 EE aa 113 EE aa 113 EE bb 252 + EE bb 252 EE bb 252 FF aa 208 FF aa 208 FF aa 208 FF aa 208 + FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 + GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160 + GG bb 160 GG bb 160 HH aa 480 HH aa 480 HH aa 480 HH bb 133 + HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 398 + II aa 398 II bb 250 II bb 250 II bb 250 II bb 250 II bb 250 + JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257 + JJ bb 257 JJ bb 257} do_execsql_test 1.16.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 AA bb 4113 AA bb 4376 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941 BB aa 6947 BB aa 7093 BB bb 6500 BB bb 6548 BB bb 6554 BB bb 6629 BB bb 6635 BB bb 6707 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964 CC bb 2300 CC bb 2776 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 3073 DD bb 3238 DD bb 3316 DD bb 3794 EE aa 1762 EE aa 2426 EE bb 1771 EE bb 1910 EE bb 2287 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460 FF bb 4730 FF bb 4798 FF bb 4942 FF bb 5094 FF bb 5373 FF bb 5566 GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 3530 GG bb 3539 GG bb 3624 GG bb 4308 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 4480 HH bb 4713 HH bb 4760 HH bb 5088 HH bb 5113 HH bb 5310 II aa 2988 II aa 3242 II bb 2835 II bb 2969 II bb 3197 II bb 3219 II bb 3390 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 JJ bb 3464 JJ bb 3543} +} {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058 + AA bb 4113 AA bb 4376 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941 + BB aa 6947 BB aa 7093 BB bb 6500 BB bb 6548 BB bb 6554 BB bb 6629 + BB bb 6635 BB bb 6707 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964 + CC bb 2300 CC bb 2776 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 3073 + DD bb 3238 DD bb 3316 DD bb 3794 EE aa 1762 EE aa 2426 EE bb 1771 + EE bb 1910 EE bb 2287 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460 + FF bb 4730 FF bb 4798 FF bb 4942 FF bb 5094 FF bb 5373 FF bb 5566 + GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 3530 GG bb 3539 + GG bb 3624 GG bb 4308 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 4480 + HH bb 4713 HH bb 4760 HH bb 5088 HH bb 5113 HH bb 5310 II aa 2988 + II aa 3242 II bb 2835 II bb 2969 II bb 3197 II bb 3219 II bb 3390 + JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 + JJ bb 3464 JJ bb 3543} do_execsql_test 1.16.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 1508 AA bb 1751 AA bb 1806 AA bb 2069 BB aa 2111 BB aa 2213 BB aa 2461 BB aa 2474 BB aa 2480 BB aa 2626 BB bb 3627 BB bb 3675 BB bb 3681 BB bb 3756 BB bb 3762 BB bb 3834 CC aa 1195 CC aa 1347 CC aa 1524 CC aa 1796 CC bb 346 CC bb 822 DD aa 480 DD aa 1069 DD aa 1101 DD bb 1748 DD bb 1913 DD bb 1991 DD bb 2469 EE aa 113 EE aa 777 EE bb 881 EE bb 1020 EE bb 1397 FF aa 1493 FF aa 1496 FF aa 1545 FF aa 1955 FF bb 2567 FF bb 2635 FF bb 2779 FF bb 2931 FF bb 3210 FF bb 3403 GG aa 963 GG aa 1117 GG aa 1262 GG aa 1449 GG bb 1933 GG bb 1942 GG bb 2027 GG bb 2711 HH aa 1270 HH aa 1459 HH aa 1769 HH bb 2231 HH bb 2464 HH bb 2511 HH bb 2839 HH bb 2864 HH bb 3061 II aa 398 II aa 652 II bb 1785 II bb 1919 II bb 2147 II bb 2169 II bb 2340 JJ aa 1115 JJ aa 1246 JJ aa 1780 JJ aa 1901 JJ bb 947 JJ bb 1432 JJ bb 1450 JJ bb 1529} +} {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 1508 AA bb 1751 + AA bb 1806 AA bb 2069 BB aa 2111 BB aa 2213 BB aa 2461 BB aa 2474 + BB aa 2480 BB aa 2626 BB bb 3627 BB bb 3675 BB bb 3681 BB bb 3756 + BB bb 3762 BB bb 3834 CC aa 1195 CC aa 1347 CC aa 1524 CC aa 1796 + CC bb 346 CC bb 822 DD aa 480 DD aa 1069 DD aa 1101 DD bb 1748 + DD bb 1913 DD bb 1991 DD bb 2469 EE aa 113 EE aa 777 EE bb 881 + EE bb 1020 EE bb 1397 FF aa 1493 FF aa 1496 FF aa 1545 FF aa 1955 + FF bb 2567 FF bb 2635 FF bb 2779 FF bb 2931 FF bb 3210 FF bb 3403 + GG aa 963 GG aa 1117 GG aa 1262 GG aa 1449 GG bb 1933 GG bb 1942 + GG bb 2027 GG bb 2711 HH aa 1270 HH aa 1459 HH aa 1769 HH bb 2231 + HH bb 2464 HH bb 2511 HH bb 2839 HH bb 2864 HH bb 3061 II aa 398 + II aa 652 II bb 1785 II bb 1919 II bb 2147 II bb 2169 II bb 2340 + JJ aa 1115 JJ aa 1246 JJ aa 1780 JJ aa 1901 JJ bb 947 JJ bb 1432 + JJ bb 1450 JJ bb 1529} do_execsql_test 1.17.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.17.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.17.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.17.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.17.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.17.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.17.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {} + AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} + BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {} + CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {} + DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {} + EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {} + FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {} + GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {} + HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {} + HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {} + II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} + JJ bb {} JJ bb {} JJ bb {}} do_execsql_test 1.18.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 22701 AA aa 22701 AA aa 22701 AA aa 22701 AA bb 22701 AA bb 22701 AA bb 22701 AA bb 22701 BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 CC aa 22150 CC aa 22150 CC aa 22150 CC aa 22150 CC bb 22150 CC bb 22150 DD aa 21758 DD aa 21758 DD aa 21758 DD bb 21758 DD bb 21758 DD bb 21758 DD bb 21758 EE aa 23019 EE aa 23019 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351 FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883 GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883 GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800 II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 22701 AA aa 22701 AA aa 22701 AA aa 22701 AA bb 22701 + AA bb 22701 AA bb 22701 AA bb 22701 BB aa 19829 BB aa 19829 + BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB bb 19829 + BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 + CC aa 22150 CC aa 22150 CC aa 22150 CC aa 22150 CC bb 22150 + CC bb 22150 DD aa 21758 DD aa 21758 DD aa 21758 DD bb 21758 + DD bb 21758 DD bb 21758 DD bb 21758 EE aa 23019 EE aa 23019 + EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351 + FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351 + FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883 + GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883 + GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440 + HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800 + II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 + JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} + JJ bb {}} do_execsql_test 1.18.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 12840 AA aa 12840 AA aa 12840 AA aa 12840 AA bb 11787 AA bb 11787 AA bb 11787 AA bb 11787 BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 CC aa 7739 CC aa 7739 CC aa 7739 CC aa 7739 CC bb 8734 CC bb 8734 DD aa 10914 DD aa 10914 DD aa 10914 DD bb 9804 DD bb 9804 DD bb 9804 DD bb 9804 EE aa 11785 EE aa 11785 EE bb 12385 EE bb 12385 EE bb 12385 FF aa 13416 FF aa 13416 FF aa 13416 FF aa 13416 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961 GG aa 11954 GG aa 11954 GG aa 11954 GG aa 11954 GG bb 11097 GG bb 11097 GG bb 11097 GG bb 11097 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 II aa 6390 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 12840 AA aa 12840 AA aa 12840 AA aa 12840 AA bb 11787 + AA bb 11787 AA bb 11787 AA bb 11787 BB aa 11621 BB aa 11621 + BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB bb 8044 + BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 CC aa 7739 + CC aa 7739 CC aa 7739 CC aa 7739 CC bb 8734 CC bb 8734 + DD aa 10914 DD aa 10914 DD aa 10914 DD bb 9804 DD bb 9804 + DD bb 9804 DD bb 9804 EE aa 11785 EE aa 11785 EE bb 12385 + EE bb 12385 EE bb 12385 FF aa 13416 FF aa 13416 FF aa 13416 + FF aa 13416 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961 + FF bb 10961 FF bb 10961 GG aa 11954 GG aa 11954 GG aa 11954 + GG aa 11954 GG bb 11097 GG bb 11097 GG bb 11097 GG bb 11097 + HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 HH bb 7440 + HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 II aa 6390 + II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa 1786 + JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} JJ bb {} + JJ bb {}} do_execsql_test 1.18.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.18.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 870 AA aa 870 AA aa 870 AA aa 870 AA bb 845 AA bb 845 AA bb 845 AA bb 845 BB aa 959 BB aa 959 BB aa 959 BB aa 959 BB aa 959 BB aa 959 BB bb 959 BB bb 959 BB bb 959 BB bb 959 BB bb 959 BB bb 959 CC aa 959 CC aa 959 CC aa 959 CC aa 959 CC bb 959 CC bb 959 DD aa 959 DD aa 959 DD aa 959 DD bb 938 DD bb 938 DD bb 938 DD bb 938 EE aa 938 EE aa 938 EE bb 979 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 GG bb 979 GG bb 979 HH aa 963 HH aa 963 HH aa 963 HH bb 899 HH bb 899 HH bb 899 HH bb 899 HH bb 899 HH bb 899 II aa 899 II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 JJ aa 839 JJ aa 839 JJ aa 839 JJ aa 839 JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 870 AA aa 870 AA aa 870 AA aa 870 AA bb 845 AA bb 845 + AA bb 845 AA bb 845 BB aa 959 BB aa 959 BB aa 959 BB aa 959 + BB aa 959 BB aa 959 BB bb 959 BB bb 959 BB bb 959 BB bb 959 + BB bb 959 BB bb 959 CC aa 959 CC aa 959 CC aa 959 CC aa 959 + CC bb 959 CC bb 959 DD aa 959 DD aa 959 DD aa 959 DD bb 938 + DD bb 938 DD bb 938 DD bb 938 EE aa 938 EE aa 938 EE bb 979 + EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 + FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 + GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 + GG bb 979 GG bb 979 HH aa 963 HH aa 963 HH aa 963 HH bb 899 + HH bb 899 HH bb 899 HH bb 899 HH bb 899 HH bb 899 II aa 899 + II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 + JJ aa 839 JJ aa 839 JJ aa 839 JJ aa 839 JJ bb {} JJ bb {} + JJ bb {} JJ bb {}} do_execsql_test 1.18.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 158 AA aa 158 AA aa 158 AA aa 158 AA bb 158 AA bb 158 AA bb 158 AA bb 158 BB aa 158 BB aa 158 BB aa 158 BB aa 158 BB aa 158 BB aa 158 BB bb 113 BB bb 113 BB bb 113 BB bb 113 BB bb 113 BB bb 113 CC aa 113 CC aa 113 CC aa 113 CC aa 113 CC bb 113 CC bb 113 DD aa 102 DD aa 102 DD aa 102 DD bb 102 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 FF bb 133 FF bb 133 FF bb 133 FF bb 133 FF bb 133 FF bb 133 GG aa 133 GG aa 133 GG aa 133 GG aa 133 GG bb 113 GG bb 113 GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 JJ aa 257 JJ aa 257 JJ aa 257 JJ aa 257 JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 158 AA aa 158 AA aa 158 AA aa 158 AA bb 158 AA bb 158 + AA bb 158 AA bb 158 BB aa 158 BB aa 158 BB aa 158 BB aa 158 + BB aa 158 BB aa 158 BB bb 113 BB bb 113 BB bb 113 BB bb 113 + BB bb 113 BB bb 113 CC aa 113 CC aa 113 CC aa 113 CC aa 113 + CC bb 113 CC bb 113 DD aa 102 DD aa 102 DD aa 102 DD bb 102 + DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 + EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 + FF bb 133 FF bb 133 FF bb 133 FF bb 133 FF bb 133 FF bb 133 + GG aa 133 GG aa 133 GG aa 133 GG aa 133 GG bb 113 GG bb 113 + GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113 + HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 + II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 + JJ aa 257 JJ aa 257 JJ aa 257 JJ aa 257 JJ bb {} JJ bb {} + JJ bb {} JJ bb {}} do_execsql_test 1.18.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 22701 AA aa 22701 AA aa 22701 AA aa 22701 AA bb 22701 AA bb 22701 AA bb 22701 AA bb 22701 BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 CC aa 22150 CC aa 22150 CC aa 22150 CC aa 22150 CC bb 22150 CC bb 22150 DD aa 21758 DD aa 21758 DD aa 21758 DD bb 21758 DD bb 21758 DD bb 21758 DD bb 21758 EE aa 23019 EE aa 23019 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351 FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883 GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883 GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800 II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 22701 AA aa 22701 AA aa 22701 AA aa 22701 AA bb 22701 + AA bb 22701 AA bb 22701 AA bb 22701 BB aa 19829 BB aa 19829 + BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB bb 19829 + BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 + CC aa 22150 CC aa 22150 CC aa 22150 CC aa 22150 CC bb 22150 + CC bb 22150 DD aa 21758 DD aa 21758 DD aa 21758 DD bb 21758 + DD bb 21758 DD bb 21758 DD bb 21758 EE aa 23019 EE aa 23019 + EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351 + FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351 + FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883 + GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883 + GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440 + HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800 + II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 + JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} + JJ bb {}} do_execsql_test 1.18.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 12840 AA aa 12840 AA aa 12840 AA aa 12840 AA bb 11787 AA bb 11787 AA bb 11787 AA bb 11787 BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 CC aa 7739 CC aa 7739 CC aa 7739 CC aa 7739 CC bb 8734 CC bb 8734 DD aa 10914 DD aa 10914 DD aa 10914 DD bb 9804 DD bb 9804 DD bb 9804 DD bb 9804 EE aa 11785 EE aa 11785 EE bb 12385 EE bb 12385 EE bb 12385 FF aa 13416 FF aa 13416 FF aa 13416 FF aa 13416 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961 GG aa 11954 GG aa 11954 GG aa 11954 GG aa 11954 GG bb 11097 GG bb 11097 GG bb 11097 GG bb 11097 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 II aa 6390 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 12840 AA aa 12840 AA aa 12840 AA aa 12840 AA bb 11787 + AA bb 11787 AA bb 11787 AA bb 11787 BB aa 11621 BB aa 11621 + BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB bb 8044 + BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 CC aa 7739 + CC aa 7739 CC aa 7739 CC aa 7739 CC bb 8734 CC bb 8734 + DD aa 10914 DD aa 10914 DD aa 10914 DD bb 9804 DD bb 9804 + DD bb 9804 DD bb 9804 EE aa 11785 EE aa 11785 EE bb 12385 + EE bb 12385 EE bb 12385 FF aa 13416 FF aa 13416 FF aa 13416 + FF aa 13416 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961 + FF bb 10961 FF bb 10961 GG aa 11954 GG aa 11954 GG aa 11954 + GG aa 11954 GG bb 11097 GG bb 11097 GG bb 11097 GG bb 11097 + HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 HH bb 7440 + HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 II aa 6390 + II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa 1786 + JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} JJ bb {} + JJ bb {}} do_execsql_test 1.19.1 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 40052 AA aa 40052 AA aa 40052 AA aa 40052 AA bb 40052 AA bb 40052 AA bb 40052 AA bb 40052 BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 CC aa 29590 CC aa 29590 CC aa 29590 CC aa 29590 CC bb 29590 CC bb 29590 DD aa 25558 DD aa 25558 DD aa 25558 DD bb 25558 DD bb 25558 DD bb 25558 DD bb 25558 EE aa 23019 EE aa 23019 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351 FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883 GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883 GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800 II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 40052 AA aa 40052 AA aa 40052 AA aa 40052 AA bb 40052 + AA bb 40052 AA bb 40052 AA bb 40052 BB aa 32712 BB aa 32712 + BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB bb 32712 + BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 + CC aa 29590 CC aa 29590 CC aa 29590 CC aa 29590 CC bb 29590 + CC bb 29590 DD aa 25558 DD aa 25558 DD aa 25558 DD bb 25558 + DD bb 25558 DD bb 25558 DD bb 25558 EE aa 23019 EE aa 23019 + EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351 + FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351 + FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883 + GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883 + GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440 + HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800 + II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 + JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} + JJ bb {}} do_execsql_test 1.19.2 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 42430 AA aa 42430 AA aa 42430 AA aa 42430 AA bb 40052 AA bb 40052 AA bb 40052 AA bb 40052 BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 CC aa 30758 CC aa 30758 CC aa 30758 CC aa 30758 CC bb 29590 CC bb 29590 DD aa 28265 DD aa 28265 DD aa 28265 DD bb 25558 DD bb 25558 DD bb 25558 DD bb 25558 EE aa 24668 EE aa 24668 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 20856 FF aa 20856 FF aa 20856 FF aa 20856 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 15754 GG aa 15754 GG aa 15754 GG aa 15754 GG bb 12883 GG bb 12883 GG bb 12883 GG bb 12883 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 II aa 6390 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 42430 AA aa 42430 AA aa 42430 AA aa 42430 AA bb 40052 + AA bb 40052 AA bb 40052 AA bb 40052 BB aa 37179 BB aa 37179 + BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB bb 32712 + BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 + CC aa 30758 CC aa 30758 CC aa 30758 CC aa 30758 CC bb 29590 + CC bb 29590 DD aa 28265 DD aa 28265 DD aa 28265 DD bb 25558 + DD bb 25558 DD bb 25558 DD bb 25558 EE aa 24668 EE aa 24668 + EE bb 23019 EE bb 23019 EE bb 23019 FF aa 20856 FF aa 20856 + FF aa 20856 FF aa 20856 FF bb 17351 FF bb 17351 FF bb 17351 + FF bb 17351 FF bb 17351 FF bb 17351 GG aa 15754 GG aa 15754 + GG aa 15754 GG aa 15754 GG bb 12883 GG bb 12883 GG bb 12883 + GG bb 12883 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 + HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 + II aa 6390 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 + JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} + JJ bb {} JJ bb {}} do_execsql_test 1.19.3 { SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 JJ bb 73 JJ bb 73 JJ bb 73} +} {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1 + AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 + BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21 + CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27 + DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34 + EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39 + FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49 + GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49 + HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57 + HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66 + II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73 + JJ bb 73 JJ bb 73 JJ bb 73} do_execsql_test 1.19.4 { SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 GG bb 979 GG bb 979 HH aa 963 HH aa 963 HH aa 963 HH bb 899 HH bb 899 HH bb 899 HH bb 899 HH bb 899 HH bb 899 II aa 899 II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 JJ aa 839 JJ aa 839 JJ aa 839 JJ aa 839 JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979 + AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979 + BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979 + BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979 + CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979 + DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979 + EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979 + FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 + GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979 + GG bb 979 GG bb 979 HH aa 963 HH aa 963 HH aa 963 HH bb 899 + HH bb 899 HH bb 899 HH bb 899 HH bb 899 HH bb 899 II aa 899 + II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899 + JJ aa 839 JJ aa 839 JJ aa 839 JJ aa 839 JJ bb {} JJ bb {} + JJ bb {} JJ bb {}} do_execsql_test 1.19.5 { SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113 GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 JJ aa 257 JJ aa 257 JJ aa 257 JJ aa 257 JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102 + AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102 + BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102 + BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102 + CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102 + DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102 + EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102 + FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 + GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113 + GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113 + HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113 + II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113 + JJ aa 257 JJ aa 257 JJ aa 257 JJ aa 257 JJ bb {} JJ bb {} + JJ bb {} JJ bb {}} do_execsql_test 1.19.6 { SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 40052 AA aa 40052 AA aa 40052 AA aa 40052 AA bb 40052 AA bb 40052 AA bb 40052 AA bb 40052 BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 CC aa 29590 CC aa 29590 CC aa 29590 CC aa 29590 CC bb 29590 CC bb 29590 DD aa 25558 DD aa 25558 DD aa 25558 DD bb 25558 DD bb 25558 DD bb 25558 DD bb 25558 EE aa 23019 EE aa 23019 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351 FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883 GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883 GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800 II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 40052 AA aa 40052 AA aa 40052 AA aa 40052 AA bb 40052 + AA bb 40052 AA bb 40052 AA bb 40052 BB aa 32712 BB aa 32712 + BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB bb 32712 + BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 + CC aa 29590 CC aa 29590 CC aa 29590 CC aa 29590 CC bb 29590 + CC bb 29590 DD aa 25558 DD aa 25558 DD aa 25558 DD bb 25558 + DD bb 25558 DD bb 25558 DD bb 25558 EE aa 23019 EE aa 23019 + EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351 + FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351 + FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883 + GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883 + GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440 + HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800 + II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 + JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {} + JJ bb {}} do_execsql_test 1.19.7 { SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3; -} {AA aa 42430 AA aa 42430 AA aa 42430 AA aa 42430 AA bb 40052 AA bb 40052 AA bb 40052 AA bb 40052 BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 CC aa 30758 CC aa 30758 CC aa 30758 CC aa 30758 CC bb 29590 CC bb 29590 DD aa 28265 DD aa 28265 DD aa 28265 DD bb 25558 DD bb 25558 DD bb 25558 DD bb 25558 EE aa 24668 EE aa 24668 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 20856 FF aa 20856 FF aa 20856 FF aa 20856 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 15754 GG aa 15754 GG aa 15754 GG aa 15754 GG bb 12883 GG bb 12883 GG bb 12883 GG bb 12883 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 II aa 6390 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} JJ bb {} JJ bb {}} +} {AA aa 42430 AA aa 42430 AA aa 42430 AA aa 42430 AA bb 40052 + AA bb 40052 AA bb 40052 AA bb 40052 BB aa 37179 BB aa 37179 + BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB bb 32712 + BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 + CC aa 30758 CC aa 30758 CC aa 30758 CC aa 30758 CC bb 29590 + CC bb 29590 DD aa 28265 DD aa 28265 DD aa 28265 DD bb 25558 + DD bb 25558 DD bb 25558 DD bb 25558 EE aa 24668 EE aa 24668 + EE bb 23019 EE bb 23019 EE bb 23019 FF aa 20856 FF aa 20856 + FF aa 20856 FF aa 20856 FF bb 17351 FF bb 17351 FF bb 17351 + FF bb 17351 FF bb 17351 FF bb 17351 GG aa 15754 GG aa 15754 + GG aa 15754 GG aa 15754 GG bb 12883 GG bb 12883 GG bb 12883 + GG bb 12883 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 + HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 + II aa 6390 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 + JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} + JJ bb {} JJ bb {}} do_execsql_test 2.1.1 { SELECT row_number() OVER win @@ -592,7 +2350,12 @@ do_execsql_test 2.1.1 { ORDER BY c, b, a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS ) -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80} +} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 + 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 + 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 + 78 79 80} do_execsql_test 2.1.2 { SELECT nth_value(c, 14) OVER win @@ -601,7 +2364,37 @@ do_execsql_test 2.1.2 { ORDER BY c, b, a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS ) -} {247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247} +} {247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247} + +do_execsql_test 2.1.3 { + SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3 + WINDOW win AS ( + ORDER BY c, b, a + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS + ) ORDER BY a, b, c; +} {102 223 1358 102 239 2293 102 911 38097 102 934 39960 102 309 4159 + 102 572 10643 102 627 13069 102 870 35417 102 247 2540 102 393 6608 + 102 399 7405 102 412 7817 102 660 16277 102 762 24077 102 633 14331 + 102 705 19673 102 711 20384 102 786 27176 102 792 28758 + 102 840 32858 102 158 767 102 430 8668 102 607 11824 102 759 23315 + 102 346 5506 102 822 31179 102 224 1582 102 256 3298 102 845 34547 + 102 238 2054 102 716 21100 102 794 29552 102 959 42795 102 113 215 + 102 777 26390 102 252 3042 102 629 13698 102 768 25613 102 208 1135 + 102 618 12442 102 667 16944 102 670 17614 102 102 102 102 295 3850 + 102 574 11217 102 726 21826 102 870 36287 102 938 40898 102 148 609 + 102 335 4824 102 480 9591 102 634 14965 102 160 927 102 844 33702 + 102 929 39026 102 938 41836 102 480 10071 102 790 27966 + 102 979 44737 102 133 461 102 330 4489 102 355 6215 102 683 18968 + 102 730 22556 102 963 43758 102 398 7006 102 652 15617 102 250 2790 + 102 421 8238 102 443 9111 102 671 18285 102 805 30357 102 113 328 + 102 234 1816 102 768 24845 102 899 37186 102 257 3555 102 336 5160 + 102 354 5860 102 839 32018} do_execsql_test 2.2.1 { SELECT row_number() OVER win @@ -610,7 +2403,12 @@ do_execsql_test 2.2.1 { ORDER BY c, b, a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW ) -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80} +} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 + 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 + 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 + 78 79 80} do_execsql_test 2.2.2 { SELECT nth_value(c, 14) OVER win @@ -619,7 +2417,37 @@ do_execsql_test 2.2.2 { ORDER BY c, b, a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW ) -} {250 250 250 250 250 250 250 250 250 250 250 250 250 250 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247} +} {250 250 250 250 250 250 250 250 250 250 250 250 250 + 250 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247} + +do_execsql_test 2.2.3 { + SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3 + WINDOW win AS ( + ORDER BY c, b, a + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW + ) ORDER BY a, b, c; +} {102 208 1135 102 238 2054 102 899 37186 102 929 39026 102 295 3850 + 102 480 10071 102 618 12442 102 845 34547 102 239 2293 102 355 6215 + 102 398 7006 102 399 7405 102 652 15617 102 759 23315 102 629 13698 + 102 683 18968 102 705 19673 102 777 26390 102 790 27966 + 102 839 32018 102 148 609 102 421 8238 102 574 11217 102 730 22556 + 102 336 5160 102 805 30357 102 223 1358 102 252 3042 102 844 33702 + 102 234 1816 102 711 20384 102 792 28758 102 938 41836 102 102 102 + 102 768 25613 102 250 2790 102 627 13069 102 768 24845 102 160 927 + 102 607 11824 102 660 16277 102 667 16944 {} {} {} 102 257 3555 + 102 572 10643 102 716 21100 102 870 35417 102 934 39960 102 133 461 + 102 330 4489 102 443 9111 102 633 14331 102 158 767 102 840 32858 + 102 911 38097 102 938 40898 102 480 9591 102 786 27176 + 102 963 43758 102 113 328 102 309 4159 102 354 5860 102 671 18285 + 102 726 21826 102 959 42795 102 393 6608 102 634 14965 102 247 2540 + 102 412 7817 102 430 8668 102 670 17614 102 794 29552 102 113 215 + 102 224 1582 102 762 24077 102 870 36287 102 256 3298 102 335 4824 + 102 346 5506 102 822 31179} do_execsql_test 2.3.1 { SELECT row_number() OVER win @@ -628,7 +2456,12 @@ do_execsql_test 2.3.1 { ORDER BY c, b, a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP ) -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80} +} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 + 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 + 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 + 78 79 80} do_execsql_test 2.3.2 { SELECT nth_value(c, 14) OVER win @@ -637,7 +2470,37 @@ do_execsql_test 2.3.2 { ORDER BY c, b, a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP ) -} {250 250 250 250 250 250 250 250 250 250 250 250 250 250 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247} +} {250 250 250 250 250 250 250 250 250 250 250 250 250 + 250 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247} + +do_execsql_test 2.3.3 { + SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3 + WINDOW win AS ( + ORDER BY c, b, a + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE GROUP + ) ORDER BY a, b, c; +} {102 208 1135 102 238 2054 102 899 37186 102 929 39026 102 295 3850 + 102 480 10071 102 618 12442 102 845 34547 102 239 2293 102 355 6215 + 102 398 7006 102 399 7405 102 652 15617 102 759 23315 102 629 13698 + 102 683 18968 102 705 19673 102 777 26390 102 790 27966 + 102 839 32018 102 148 609 102 421 8238 102 574 11217 102 730 22556 + 102 336 5160 102 805 30357 102 223 1358 102 252 3042 102 844 33702 + 102 234 1816 102 711 20384 102 792 28758 102 938 41836 102 102 102 + 102 768 25613 102 250 2790 102 627 13069 102 768 24845 102 160 927 + 102 607 11824 102 660 16277 102 667 16944 {} {} {} 102 257 3555 + 102 572 10643 102 716 21100 102 870 35417 102 934 39960 102 133 461 + 102 330 4489 102 443 9111 102 633 14331 102 158 767 102 840 32858 + 102 911 38097 102 938 40898 102 480 9591 102 786 27176 + 102 963 43758 102 113 328 102 309 4159 102 354 5860 102 671 18285 + 102 726 21826 102 959 42795 102 393 6608 102 634 14965 102 247 2540 + 102 412 7817 102 430 8668 102 670 17614 102 794 29552 102 113 215 + 102 224 1582 102 762 24077 102 870 36287 102 256 3298 102 335 4824 + 102 346 5506 102 822 31179} do_execsql_test 2.4.1 { SELECT row_number() OVER win @@ -646,7 +2509,12 @@ do_execsql_test 2.4.1 { ORDER BY c, b, a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES ) -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80} +} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 + 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 + 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 + 78 79 80} do_execsql_test 2.4.2 { SELECT nth_value(c, 14) OVER win @@ -655,7 +2523,37 @@ do_execsql_test 2.4.2 { ORDER BY c, b, a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES ) -} {247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247 247} +} {247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247 247 247 247 247 247 247 247 247 247 247 247 + 247 247} + +do_execsql_test 2.4.3 { + SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3 + WINDOW win AS ( + ORDER BY c, b, a + ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES + ) ORDER BY a, b, c; +} {102 223 1358 102 239 2293 102 911 38097 102 934 39960 102 309 4159 + 102 572 10643 102 627 13069 102 870 35417 102 247 2540 102 393 6608 + 102 399 7405 102 412 7817 102 660 16277 102 762 24077 102 633 14331 + 102 705 19673 102 711 20384 102 786 27176 102 792 28758 + 102 840 32858 102 158 767 102 430 8668 102 607 11824 102 759 23315 + 102 346 5506 102 822 31179 102 224 1582 102 256 3298 102 845 34547 + 102 238 2054 102 716 21100 102 794 29552 102 959 42795 102 113 215 + 102 777 26390 102 252 3042 102 629 13698 102 768 25613 102 208 1135 + 102 618 12442 102 667 16944 102 670 17614 102 102 102 102 295 3850 + 102 574 11217 102 726 21826 102 870 36287 102 938 40898 102 148 609 + 102 335 4824 102 480 9591 102 634 14965 102 160 927 102 844 33702 + 102 929 39026 102 938 41836 102 480 10071 102 790 27966 + 102 979 44737 102 133 461 102 330 4489 102 355 6215 102 683 18968 + 102 730 22556 102 963 43758 102 398 7006 102 652 15617 102 250 2790 + 102 421 8238 102 443 9111 102 671 18285 102 805 30357 102 113 328 + 102 234 1816 102 768 24845 102 899 37186 102 257 3555 102 336 5160 + 102 354 5860 102 839 32018} #========================================================================== @@ -715,4 +2613,19 @@ do_execsql_test 3.12 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 2.1 FOLLOWING AND UNBOUNDED FOLLOWING ) } {30 232 22 112 20 112 15 30 13 30 13 30 10 10 5 {}} +#========================================================================== + +do_execsql_test 4.0 { + DROP TABLE IF EXISTS t1; + CREATE TABLE t1(a INTEGER, b INTEGER); + INSERT INTO t1 VALUES + (NULL, 1), (NULL, 2), (NULL, 3), (10, 4), (10, 5); +} {} + +do_execsql_test 4.1 { + SELECT sum(b) OVER ( + ORDER BY a RANGE BETWEEN 5 PRECEDING AND 10 FOLLOWING + ) FROM t1 ORDER BY 1; +} {6 6 6 9 9} + finish_test