# 2019 March 01 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. # #################################################### # DO NOT EDIT! THIS FILE IS AUTOMATICALLY GENERATED! #################################################### set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix window8 ifcapable !windowfunc { finish_test ; return } do_execsql_test 1.0 { DROP TABLE IF EXISTS t3; CREATE TABLE t3(a TEXT, b TEXT, c INTEGER); INSERT INTO t3 VALUES ('HH', 'bb', 355), ('CC', 'aa', 158), ('BB', 'aa', 399), ('FF', 'bb', 938), ('HH', 'aa', 480), ('FF', 'bb', 870), ('JJ', 'aa', 768), ('JJ', 'aa', 899), ('GG', 'bb', 929), ('II', 'bb', 421), ('GG', 'bb', 844), ('FF', 'bb', 574), ('CC', 'bb', 822), ('GG', 'bb', 938), ('BB', 'aa', 660), ('HH', 'aa', 979), ('BB', 'bb', 792), ('DD', 'aa', 845), ('JJ', 'bb', 354), ('FF', 'bb', 295), ('JJ', 'aa', 234), ('BB', 'bb', 840), ('AA', 'aa', 934), ('EE', 'aa', 113), ('AA', 'bb', 309), ('BB', 'aa', 412), ('AA', 'aa', 911), ('AA', 'bb', 572), ('II', 'aa', 398), ('II', 'bb', 250), ('II', 'aa', 652), ('BB', 'bb', 633), ('AA', 'aa', 239), ('FF', 'aa', 670), ('BB', 'bb', 705), ('HH', 'bb', 963), ('CC', 'bb', 346), ('II', 'bb', 671), ('BB', 'aa', 247), ('AA', 'aa', 223), ('GG', 'aa', 480), ('HH', 'aa', 790), ('FF', 'aa', 208), ('BB', 'bb', 711), ('EE', 'aa', 777), ('DD', 'bb', 716), ('CC', 'aa', 759), ('CC', 'aa', 430), ('CC', 'aa', 607), ('DD', 'bb', 794), ('GG', 'aa', 148), ('GG', 'aa', 634), ('JJ', 'bb', 257), ('DD', 'bb', 959), ('FF', 'bb', 726), ('BB', 'aa', 762), ('JJ', 'bb', 336), ('GG', 'aa', 335), ('HH', 'bb', 330), ('GG', 'bb', 160), ('JJ', 'bb', 839), ('FF', 'aa', 618), ('BB', 'aa', 393), ('EE', 'bb', 629), ('FF', 'aa', 667), ('AA', 'bb', 870), ('FF', 'bb', 102), ('JJ', 'aa', 113), ('DD', 'aa', 224), ('AA', 'bb', 627), ('HH', 'bb', 730), ('II', 'bb', 443), ('HH', 'bb', 133), ('EE', 'bb', 252), ('II', 'bb', 805), ('BB', 'bb', 786), ('EE', 'bb', 768), ('HH', 'bb', 683), ('DD', 'bb', 238), ('DD', 'aa', 256); } {} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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 {}} 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 {}} 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} 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 {}} 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 {}} 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 {}} 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 {}} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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} 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 {}} 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 {}} 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} 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 {}} 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 {}} 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 {}} 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 {}} 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 {}} 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 {}} 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} 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 {}} 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 {}} 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 {}} 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 {}} 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 {}} 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 {}} 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} 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 {}} 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 {}} 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 {}} 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 {}} do_execsql_test 2.1.1 { SELECT row_number() OVER win FROM t3 WINDOW win AS ( 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} do_execsql_test 2.1.2 { SELECT nth_value(c, 14) OVER win FROM t3 WINDOW win AS ( 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} 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 FROM t3 WINDOW win AS ( 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} do_execsql_test 2.2.2 { SELECT nth_value(c, 14) OVER win FROM t3 WINDOW win AS ( 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} 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 FROM t3 WINDOW win AS ( 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} do_execsql_test 2.3.2 { SELECT nth_value(c, 14) OVER win FROM t3 WINDOW win AS ( 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} 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 FROM t3 WINDOW win AS ( 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} do_execsql_test 2.4.2 { SELECT nth_value(c, 14) OVER win FROM t3 WINDOW win AS ( 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} 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} #========================================================================== do_execsql_test 3.0 { DROP TABLE IF EXISTS t1; CREATE TABLE t1(a REAL, b INTEGER); INSERT INTO t1 VALUES (5, 10), (10, 20), (13, 26), (13, 26), (15, 30), (20, 40), (22,80), (30, 90); } {} do_execsql_test 3.1 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 5 PRECEDING AND 5 FOLLOWING ) } {5 30 10 112 13 102 13 102 15 142 20 150 22 120 30 90} do_execsql_test 3.2 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 10 PRECEDING AND 5 PRECEDING ) } {5 {} 10 10 13 10 13 10 15 30 20 102 22 82 30 120} do_execsql_test 3.3 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 2 FOLLOWING AND 3 FOLLOWING ) } {5 {} 10 52 13 30 13 30 15 {} 20 80 22 {} 30 {}} do_execsql_test 3.4 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 5 PRECEDING AND 5 FOLLOWING ) } {30 90 22 120 20 150 15 142 13 102 13 102 10 112 5 30} do_execsql_test 3.5 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 10 PRECEDING AND 5 PRECEDING ) } {30 {} 22 90 20 90 15 120 13 120 13 120 10 70 5 102} do_execsql_test 3.6 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 2 FOLLOWING AND 3 FOLLOWING ) } {30 {} 22 40 20 {} 15 52 13 20 13 20 10 {} 5 {}} do_execsql_test 3.7 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 5.1 PRECEDING AND 5.3 FOLLOWING ) } {5 30 10 112 13 102 13 102 15 142 20 150 22 120 30 90} do_execsql_test 3.8 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 10.2 PRECEDING AND 5.4 PRECEDING ) } {5 {} 10 {} 13 10 13 10 15 10 20 72 22 82 30 120} do_execsql_test 3.9 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 2.6 FOLLOWING AND 3.5 FOLLOWING ) } {5 {} 10 52 13 {} 13 {} 15 {} 20 {} 22 {} 30 {}} do_execsql_test 3.10 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 5.7 PRECEDING AND 5.8 FOLLOWING ) } {30 90 22 120 20 150 15 142 13 102 13 102 10 112 5 30} do_execsql_test 3.11 { SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN UNBOUNDED PRECEDING AND 5.9 PRECEDING ) } {30 {} 22 90 20 90 15 170 13 210 13 210 10 210 5 292} 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.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} do_execsql_test 4.1.2 { SELECT sum(b) OVER ( ORDER BY a DESC RANGE BETWEEN 5 PRECEDING AND 10 FOLLOWING ) FROM t1 ORDER BY 1; } {6 6 6 9 9} do_execsql_test 4.2.1 { SELECT sum(b) OVER ( ORDER BY a RANGE BETWEEN 5 FOLLOWING AND 10 FOLLOWING ) FROM t1 ORDER BY 1 ; } {{} {} 6 6 6} do_execsql_test 4.2.2 { SELECT sum(b) OVER ( ORDER BY a DESC RANGE BETWEEN 5 FOLLOWING AND 10 FOLLOWING ) FROM t1 ORDER BY 1 ; } {{} {} 6 6 6} do_execsql_test 4.3.1 { SELECT sum(b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND 10 FOLLOWING ) FROM t1 ORDER BY 1 ; } {6 6 6 15 15} do_execsql_test 4.4.1 { SELECT sum(b) OVER ( ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING ) FROM t1 ORDER BY 1 ; } {3 6 9 9 12} do_execsql_test 4.4.2 { SELECT sum(b) OVER ( ORDER BY a DESC ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING ) FROM t1 ORDER BY 1 ; } {5 6 8 9 10} finish_test