/ Check-in [cebe09e1]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix problems with RANGE windows and string, blob and NULL values.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | window-functions
Files: files | file ages | folders
SHA3-256: cebe09e11cc91d9776f259dd9b87e9c760a460f53ba6fa36481dfe58f77ad417
User & Date: dan 2019-03-16 20:29:54
Wiki:window-functions
Context
2019-03-18
16:51
Fixes for RANGE windows and NULL values. check-in: 723c84be user: dan tags: window-functions
2019-03-16
20:29
Fix problems with RANGE windows and string, blob and NULL values. check-in: cebe09e1 user: dan tags: window-functions
10:15
In order to identify the first row of each partition, check if the rowid in the ephemeral table is 1 instead of using a dedicated flag register. check-in: f2d5f7a2 user: dan tags: window-functions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

  1708   1708   frame_bound_e(A) ::= UNBOUNDED FOLLOWING. {A.eType = TK_UNBOUNDED; A.pExpr = 0;}
  1709   1709   
  1710   1710   frame_bound(A) ::= expr(X) PRECEDING.   { A.eType = TK_PRECEDING; A.pExpr = X; }
  1711   1711   frame_bound(A) ::= CURRENT ROW.         { A.eType = TK_CURRENT  ; A.pExpr = 0; }
  1712   1712   frame_bound(A) ::= expr(X) FOLLOWING.   { A.eType = TK_FOLLOWING; A.pExpr = X; }
  1713   1713   
  1714   1714   %type frame_exclude_opt {u8}
  1715         -frame_exclude_opt(A) ::= . { A = TK_NO; }
         1715  +frame_exclude_opt(A) ::= . { A = 0; }
  1716   1716   frame_exclude_opt(A) ::= EXCLUDE frame_exclude(X). { A = X; }
  1717   1717   
  1718   1718   %type frame_exclude {u8}
  1719   1719   frame_exclude(A) ::= NO OTHERS.   { A = 0; }
  1720   1720   frame_exclude(A) ::= CURRENT ROW. { A = TK_CURRENT; }
  1721   1721   frame_exclude(A) ::= GROUP.       { A = TK_GROUP; }
  1722   1722   frame_exclude(A) ::= TIES.        { A = TK_TIES; }

Changes to src/window.c.

  1072   1072     pWin->eType = eType;
  1073   1073     pWin->eStart = eStart;
  1074   1074     pWin->eEnd = eEnd;
  1075   1075     pWin->eExclude = eExclude;
  1076   1076     pWin->bImplicitFrame = bImplicitFrame;
  1077   1077     pWin->pEnd = sqlite3WindowOffsetExpr(pParse, pEnd);
  1078   1078     pWin->pStart = sqlite3WindowOffsetExpr(pParse, pStart);
  1079         -  /* pWin->eExclude = 1; */
  1080   1079     return pWin;
  1081   1080   
  1082   1081   windowAllocErr:
  1083   1082     sqlite3ExprDelete(pParse->db, pEnd);
  1084   1083     sqlite3ExprDelete(pParse->db, pStart);
  1085   1084     return 0;
  1086   1085   }
................................................................................
  1738   1737     }else{
  1739   1738       sqlite3VdbeAddOp2(v, OP_Goto, 0, addr);
  1740   1739     }
  1741   1740   }
  1742   1741   
  1743   1742   /*
  1744   1743   ** This function is called as part of generating VM programs for RANGE
  1745         -** offset PRECEDING/FOLLOWING frame boundaries. It generates code equivalent
  1746         -** to:
         1744  +** offset PRECEDING/FOLLOWING frame boundaries. Assuming "ASC" order for
         1745  +** the ORDER BY term in the window, it generates code equivalent to:
  1747   1746   **
  1748   1747   **   if( csr1.peerVal + regVal >= csr2.peerVal ) goto lbl;
  1749         -**   if( csr1.rowid >= csr2.rowid ) goto lbl;
         1748  +**
         1749  +** A special type of arithmetic is used such that if csr.peerVal is not
         1750  +** a numeric type (real or integer), then the result of the addition is
         1751  +** a copy of csr1.peerVal.
  1750   1752   */
  1751   1753   static void windowCodeRangeTest(
  1752   1754     WindowCodeArg *p, 
  1753   1755     int op,                          /* OP_Ge or OP_Gt */
  1754   1756     int csr1, 
  1755   1757     int regVal, 
  1756   1758     int csr2,
................................................................................
  1757   1759     int lbl
  1758   1760   ){
  1759   1761     Parse *pParse = p->pParse;
  1760   1762     Vdbe *v = sqlite3GetVdbe(pParse);
  1761   1763     int reg1 = sqlite3GetTempReg(pParse);
  1762   1764     int reg2 = sqlite3GetTempReg(pParse);
  1763   1765     int arith = OP_Add;
         1766  +  int addrGe;
         1767  +  int addrNotNull;
         1768  +
         1769  +  int regString = ++pParse->nMem;
  1764   1770   
  1765   1771     assert( op==OP_Ge || op==OP_Gt || op==OP_Le );
  1766   1772     assert( p->pMWin->pOrderBy && p->pMWin->pOrderBy->nExpr==1 );
  1767   1773     if( p->pMWin->pOrderBy->a[0].sortOrder ){
  1768   1774       switch( op ){
  1769   1775         case OP_Ge: op = OP_Le; break;
  1770   1776         case OP_Gt: op = OP_Lt; break;
................................................................................
  1771   1777         default: assert( op==OP_Le ); op = OP_Ge; break;
  1772   1778       }
  1773   1779       arith = OP_Subtract;
  1774   1780     }
  1775   1781   
  1776   1782     windowReadPeerValues(p, csr1, reg1);
  1777   1783     windowReadPeerValues(p, csr2, reg2);
         1784  +
         1785  +  /* Check if the peer value for csr1 value is a text or blob by comparing
         1786  +  ** it to the smallest possible string - ''. */
         1787  +  sqlite3VdbeAddOp4(v, OP_String8, 0, regString, 0, "", P4_STATIC);
         1788  +  addrGe = sqlite3VdbeAddOp3(v, OP_Ge, regString, 0, reg1);
         1789  +
         1790  +  if( op==OP_Le ){
         1791  +    sqlite3VdbeAddOp2(v, OP_IsNull, reg1, lbl);
         1792  +  }
         1793  +  if( op==OP_Ge ){
         1794  +    sqlite3VdbeAddOp2(v, OP_NotNull, reg1, sqlite3VdbeCurrentAddr(v)+2);
         1795  +    sqlite3VdbeAddOp2(v, OP_IsNull, reg2, lbl);
         1796  +  }
         1797  +
  1778   1798     sqlite3VdbeAddOp3(v, arith, regVal, reg1, reg1);
         1799  +  sqlite3VdbeJumpHere(v, addrGe);
  1779   1800     sqlite3VdbeAddOp3(v, op, reg2, lbl, reg1);
  1780         -  sqlite3VdbeAddOp2(v, OP_Rowid, csr1, reg1);
  1781         -  sqlite3VdbeAddOp2(v, OP_Rowid, csr2, reg2);
  1782         -  sqlite3VdbeAddOp3(v, OP_Gt, reg2, lbl, reg1);
         1801  +
  1783   1802     sqlite3ReleaseTempReg(pParse, reg1);
  1784   1803     sqlite3ReleaseTempReg(pParse, reg2);
  1785   1804   }
  1786   1805   
  1787   1806   static int windowCodeOp(
  1788   1807    WindowCodeArg *p,
  1789   1808    int op,

Changes to test/pg_common.tcl.

    36     36     }
    37     37     if {$frag != ""} {
    38     38       lappend lSql $frag
    39     39     }
    40     40     #puts $lSql
    41     41   
    42     42     set ret ""
           43  +  set nChar 0
    43     44     foreach stmt $lSql {
    44     45       set res [pg_exec $::db $stmt]
    45     46       set err [pg_result $res -error]
    46     47       if {$err!=""} { error $err }
           48  +
    47     49       for {set i 0} {$i < [pg_result $res -numTuples]} {incr i} {
    48         -      if {$i==0} {
    49         -        set ret [pg_result $res -getTuple 0]
           50  +      set t [pg_result $res -getTuple $i]
           51  +      set nNew [string length $t]
           52  +      if {$nChar>0 && ($nChar+$nNew+3)>75} {
           53  +        append ret "\n  "
           54  +        set nChar 0
    50     55         } else {
    51         -        append ret "   [pg_result $res -getTuple $i]"
           56  +        if {$nChar>0} {
           57  +          append ret "   "
           58  +          incr nChar 3
           59  +        }
    52     60         }
    53         -      # lappend ret {*}[pg_result $res -getTuple $i]
           61  +      incr nChar $nNew
           62  +      append ret $t
    54     63       }
    55     64       pg_result $res -clear
    56     65     }
    57     66   
    58     67     set ret
    59     68   }
    60     69   

Changes to test/window1.test.

   845    845     WINDOW win1 AS (PARTITION BY b),
   846    846            win2 AS (win1),
   847    847            win3 AS (win2),
   848    848            win4 AS (win3),
   849    849            win5 AS (win4 ORDER BY c)
   850    850   } {four four.six four.six.two five five.one five.one.three}
   851    851   
          852  +#-------------------------------------------------------------------------
          853  +# Test RANGE <expr> PRECEDING/FOLLOWING when there are string, blob
          854  +# and NULL values in the dataset.
          855  +#
          856  +reset_db
          857  +do_execsql_test 19.0 {
          858  +  CREATE TABLE t1(a, b);
          859  +  INSERT INTO t1 VALUES
          860  +    (1, 1), (2, 2), (3, 3), (4, 4), (5, 5),
          861  +    ('a', 6), ('b', 7), ('c', 8), ('d', 9), ('e', 10);
          862  +}
          863  +do_execsql_test 19.1 {
          864  +  SELECT a, sum(b) OVER (ORDER BY a) FROM t1;
          865  +} {1 1  2 3  3 6  4 10  5 15  a 21 b 28 c 36 d 45 e 55}
          866  +
          867  +do_execsql_test 19.2.1 {
          868  +  SELECT a, sum(b) OVER (
          869  +    ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING
          870  +  ) FROM t1;
          871  +} {1 3 2 6 3 9 4 12 5 9 a 6 b 7 c 8 d 9 e 10}
          872  +do_execsql_test 19.2.2 {
          873  +  SELECT a, sum(b) OVER (
          874  +    ORDER BY a DESC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING
          875  +  ) FROM t1 ORDER BY a ASC;
          876  +} {1 3 2 6 3 9 4 12 5 9 a 6 b 7 c 8 d 9 e 10}
          877  +
          878  +do_execsql_test 19.3.1 {
          879  +  SELECT a, sum(b) OVER (
          880  +    ORDER BY a RANGE BETWEEN 2 PRECEDING AND 1 FOLLOWING
          881  +  ) FROM t1;
          882  +} {1 3 2 6 3 10 4 14 5 12 a 6 b 7 c 8 d 9 e 10}
          883  +do_execsql_test 19.3.2 {
          884  +  SELECT a, sum(b) OVER (
          885  +    ORDER BY a DESC RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING
          886  +  ) FROM t1 ORDER BY a ASC;
          887  +} {1 3 2 6 3 10 4 14 5 12 a 6 b 7 c 8 d 9 e 10}
          888  +
          889  +
          890  +reset_db
          891  +do_execsql_test 20.0 {
          892  +  CREATE TABLE t1(a, b);
          893  +  INSERT INTO t1 VALUES
          894  +    (NULL, 100), (NULL, 100), 
          895  +    (1, 1), (2, 2), (3, 3), (4, 4), (5, 5),
          896  +    ('a', 6), ('b', 7), ('c', 8), ('d', 9), ('e', 10);
          897  +}
          898  +do_execsql_test 20.1 {
          899  +  SELECT a, sum(b) OVER (ORDER BY a) FROM t1;
          900  +} {
          901  +  {} 200 {} 200 1 201  2 203  3 206  4 210  5 215  
          902  +  a 221 b 228 c 236 d 245 e 255
          903  +}
          904  +
          905  +do_execsql_test 20.2.1 {
          906  +  SELECT a, sum(b) OVER (
          907  +    ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING
          908  +  ) FROM t1;
          909  +} {{} 200 {} 200 1 3 2 6 3 9 4 12 5 9 a 6 b 7 c 8 d 9 e 10}
          910  +do_execsql_test 20.2.2 {
          911  +  SELECT a, sum(b) OVER (
          912  +    ORDER BY a DESC RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING
          913  +  ) FROM t1 ORDER BY a ASC;
          914  +} {{} 200 {} 200 1 3 2 6 3 9 4 12 5 9 a 6 b 7 c 8 d 9 e 10}
          915  +
          916  +do_execsql_test 20.3.1 {
          917  +  SELECT a, sum(b) OVER (
          918  +    ORDER BY a RANGE BETWEEN 2 PRECEDING AND 1 FOLLOWING
          919  +  ) FROM t1;
          920  +} {{} 200 {} 200 1 3 2 6 3 10 4 14 5 12 a 6 b 7 c 8 d 9 e 10}
          921  +do_execsql_test 20.3.2 {
          922  +  SELECT a, sum(b) OVER (
          923  +    ORDER BY a DESC RANGE BETWEEN 1 PRECEDING AND 2 FOLLOWING
          924  +  ) FROM t1 ORDER BY a ASC;
          925  +} {{} 200 {} 200 1 3 2 6 3 10 4 14 5 12 a 6 b 7 c 8 d 9 e 10}
          926  +
   852    927   finish_test
          928  +
          929  +

Changes to test/window8.tcl.

   118    118       SELECT nth_value(c, 14) OVER win 
   119    119       FROM t3
   120    120       WINDOW win AS (
   121    121         ORDER BY c, b, a
   122    122         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING $ex
   123    123       )
   124    124     "
          125  +
          126  +  execsql_test 2.$tn.3 "
          127  +    SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
          128  +    WINDOW win AS (
          129  +      ORDER BY c, b, a
          130  +      ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW $ex
          131  +    ) ORDER BY a, b, c;
          132  +  "
   125    133   }
   126    134   
   127    135   ==========
   128    136   
   129    137   execsql_test 3.0 {
   130    138     DROP TABLE IF EXISTS t1;
   131    139     CREATE TABLE t1(a REAL, b INTEGER);
................................................................................
   150    158     12 { ORDER BY a DESC RANGE BETWEEN 2.1 FOLLOWING AND UNBOUNDED FOLLOWING }
   151    159   } {
   152    160     execsql_test 3.$tn "
   153    161       SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ($frame)
   154    162     "
   155    163   }
   156    164   
          165  +==========
          166  +
          167  +execsql_test 4.0 {
          168  +  DROP TABLE IF EXISTS t1;
          169  +  CREATE TABLE t1(a INTEGER, b INTEGER);
          170  +  INSERT INTO t1 VALUES
          171  +    (NULL, 1), (NULL, 2), (NULL, 3), (10, 4), (10, 5);
          172  +}
          173  +
          174  +execsql_test 4.1 {
          175  +  SELECT sum(b) OVER (
          176  +    ORDER BY a RANGE BETWEEN 5 PRECEDING AND 10 FOLLOWING
          177  +  ) FROM t1 ORDER BY 1;
          178  +}
   157    179   
   158    180   finish_test
   159    181   
   160    182   

Changes to test/window8.test.

    51     51       ('HH', 'bb', 133), ('EE', 'bb', 252), ('II', 'bb', 805), 
    52     52       ('BB', 'bb', 786), ('EE', 'bb', 768), ('HH', 'bb', 683), 
    53     53       ('DD', 'bb', 238), ('DD', 'aa', 256);
    54     54   } {}
    55     55   
    56     56   do_execsql_test 1.1.1 {
    57     57     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
    58         -} {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}
           58  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
           59  +  AA bb {}   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
           60  +  BB aa 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685
           61  +  BB bb 4685   CC aa 12025   CC aa 12025   CC aa 12025   CC aa 12025
           62  +  CC bb 12025   CC bb 12025   DD aa 15147   DD aa 15147   DD aa 15147
           63  +  DD bb 15147   DD bb 15147   DD bb 15147   DD bb 15147   EE aa 19179
           64  +  EE aa 19179   EE bb 19179   EE bb 19179   EE bb 19179   FF aa 21718
           65  +  FF aa 21718   FF aa 21718   FF aa 21718   FF bb 21718   FF bb 21718
           66  +  FF bb 21718   FF bb 21718   FF bb 21718   FF bb 21718   GG aa 27386
           67  +  GG aa 27386   GG aa 27386   GG aa 27386   GG bb 27386   GG bb 27386
           68  +  GG bb 27386   GG bb 27386   HH aa 31854   HH aa 31854   HH aa 31854
           69  +  HH bb 31854   HH bb 31854   HH bb 31854   HH bb 31854   HH bb 31854
           70  +  HH bb 31854   II aa 37297   II aa 37297   II bb 37297   II bb 37297
           71  +  II bb 37297   II bb 37297   II bb 37297   JJ aa 40937   JJ aa 40937
           72  +  JJ aa 40937   JJ aa 40937   JJ bb 40937   JJ bb 40937   JJ bb 40937
           73  +  JJ bb 40937}
    59     74   
    60     75   do_execsql_test 1.1.2 {
    61     76     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
    62         -} {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}
           77  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 2307   AA bb 2307
           78  +  AA bb 2307   AA bb 2307   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
           79  +  BB aa 4685   BB aa 4685   BB bb 7558   BB bb 7558   BB bb 7558   BB bb 7558
           80  +  BB bb 7558   BB bb 7558   CC aa 12025   CC aa 12025   CC aa 12025
           81  +  CC aa 12025   CC bb 13979   CC bb 13979   DD aa 15147   DD aa 15147
           82  +  DD aa 15147   DD bb 16472   DD bb 16472   DD bb 16472   DD bb 16472
           83  +  EE aa 19179   EE aa 19179   EE bb 20069   EE bb 20069   EE bb 20069
           84  +  FF aa 21718   FF aa 21718   FF aa 21718   FF aa 21718   FF bb 23881
           85  +  FF bb 23881   FF bb 23881   FF bb 23881   FF bb 23881   FF bb 23881
           86  +  GG aa 27386   GG aa 27386   GG aa 27386   GG aa 27386   GG bb 28983
           87  +  GG bb 28983   GG bb 28983   GG bb 28983   HH aa 31854   HH aa 31854
           88  +  HH aa 31854   HH bb 34103   HH bb 34103   HH bb 34103   HH bb 34103
           89  +  HH bb 34103   HH bb 34103   II aa 37297   II aa 37297   II bb 38347
           90  +  II bb 38347   II bb 38347   II bb 38347   II bb 38347   JJ aa 40937
           91  +  JJ aa 40937   JJ aa 40937   JJ aa 40937   JJ bb 42951   JJ bb 42951
           92  +  JJ bb 42951   JJ bb 42951}
    63     93   
    64     94   do_execsql_test 1.1.3 {
    65     95     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
    66         -} {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}
           96  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
           97  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
           98  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
           99  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
          100  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
          101  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
          102  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
          103  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
          104  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
          105  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
          106  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
          107  +  JJ bb 73   JJ bb 73   JJ bb 73}
    67    108   
    68    109   do_execsql_test 1.1.4 {
    69    110     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
    70         -} {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}
          111  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 934   AA bb 934
          112  +  AA bb 934   AA bb 934   BB aa 934   BB aa 934   BB aa 934   BB aa 934
          113  +  BB aa 934   BB aa 934   BB bb 934   BB bb 934   BB bb 934   BB bb 934
          114  +  BB bb 934   BB bb 934   CC aa 934   CC aa 934   CC aa 934   CC aa 934
          115  +  CC bb 934   CC bb 934   DD aa 934   DD aa 934   DD aa 934   DD bb 934
          116  +  DD bb 934   DD bb 934   DD bb 934   EE aa 959   EE aa 959   EE bb 959
          117  +  EE bb 959   EE bb 959   FF aa 959   FF aa 959   FF aa 959   FF aa 959
          118  +  FF bb 959   FF bb 959   FF bb 959   FF bb 959   FF bb 959   FF bb 959
          119  +  GG aa 959   GG aa 959   GG aa 959   GG aa 959   GG bb 959   GG bb 959
          120  +  GG bb 959   GG bb 959   HH aa 959   HH aa 959   HH aa 959   HH bb 979
          121  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
          122  +  II aa 979   II bb 979   II bb 979   II bb 979   II bb 979   II bb 979
          123  +  JJ aa 979   JJ aa 979   JJ aa 979   JJ aa 979   JJ bb 979   JJ bb 979
          124  +  JJ bb 979   JJ bb 979}
    71    125   
    72    126   do_execsql_test 1.1.5 {
    73    127     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
    74         -} {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}
          128  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 223   AA bb 223
          129  +  AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223
          130  +  BB aa 223   BB aa 223   BB bb 223   BB bb 223   BB bb 223   BB bb 223
          131  +  BB bb 223   BB bb 223   CC aa 223   CC aa 223   CC aa 223   CC aa 223
          132  +  CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 158
          133  +  DD bb 158   DD bb 158   DD bb 158   EE aa 158   EE aa 158   EE bb 113
          134  +  EE bb 113   EE bb 113   FF aa 113   FF aa 113   FF aa 113   FF aa 113
          135  +  FF bb 113   FF bb 113   FF bb 113   FF bb 113   FF bb 113   FF bb 113
          136  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
          137  +  GG bb 102   GG bb 102   HH aa 102   HH aa 102   HH aa 102   HH bb 102
          138  +  HH bb 102   HH bb 102   HH bb 102   HH bb 102   HH bb 102   II aa 102
          139  +  II aa 102   II bb 102   II bb 102   II bb 102   II bb 102   II bb 102
          140  +  JJ aa 102   JJ aa 102   JJ aa 102   JJ aa 102   JJ bb 102   JJ bb 102
          141  +  JJ bb 102   JJ bb 102}
    75    142   
    76    143   do_execsql_test 1.1.6 {
    77    144     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;
    78         -} {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}
          145  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          146  +  AA bb {}   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          147  +  BB aa 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685
          148  +  BB bb 4685   CC aa 12025   CC aa 12025   CC aa 12025   CC aa 12025
          149  +  CC bb 12025   CC bb 12025   DD aa 15147   DD aa 15147   DD aa 15147
          150  +  DD bb 15147   DD bb 15147   DD bb 15147   DD bb 15147   EE aa 19179
          151  +  EE aa 19179   EE bb 19179   EE bb 19179   EE bb 19179   FF aa 21718
          152  +  FF aa 21718   FF aa 21718   FF aa 21718   FF bb 21718   FF bb 21718
          153  +  FF bb 21718   FF bb 21718   FF bb 21718   FF bb 21718   GG aa 27386
          154  +  GG aa 27386   GG aa 27386   GG aa 27386   GG bb 27386   GG bb 27386
          155  +  GG bb 27386   GG bb 27386   HH aa 31854   HH aa 31854   HH aa 31854
          156  +  HH bb 31854   HH bb 31854   HH bb 31854   HH bb 31854   HH bb 31854
          157  +  HH bb 31854   II aa 37297   II aa 37297   II bb 37297   II bb 37297
          158  +  II bb 37297   II bb 37297   II bb 37297   JJ aa 40937   JJ aa 40937
          159  +  JJ aa 40937   JJ aa 40937   JJ bb 40937   JJ bb 40937   JJ bb 40937
          160  +  JJ bb 40937}
    79    161   
    80    162   do_execsql_test 1.1.7 {
    81    163     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;
    82         -} {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}
          164  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 2307   AA bb 2307
          165  +  AA bb 2307   AA bb 2307   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          166  +  BB aa 4685   BB aa 4685   BB bb 7558   BB bb 7558   BB bb 7558   BB bb 7558
          167  +  BB bb 7558   BB bb 7558   CC aa 12025   CC aa 12025   CC aa 12025
          168  +  CC aa 12025   CC bb 13979   CC bb 13979   DD aa 15147   DD aa 15147
          169  +  DD aa 15147   DD bb 16472   DD bb 16472   DD bb 16472   DD bb 16472
          170  +  EE aa 19179   EE aa 19179   EE bb 20069   EE bb 20069   EE bb 20069
          171  +  FF aa 21718   FF aa 21718   FF aa 21718   FF aa 21718   FF bb 23881
          172  +  FF bb 23881   FF bb 23881   FF bb 23881   FF bb 23881   FF bb 23881
          173  +  GG aa 27386   GG aa 27386   GG aa 27386   GG aa 27386   GG bb 28983
          174  +  GG bb 28983   GG bb 28983   GG bb 28983   HH aa 31854   HH aa 31854
          175  +  HH aa 31854   HH bb 34103   HH bb 34103   HH bb 34103   HH bb 34103
          176  +  HH bb 34103   HH bb 34103   II aa 37297   II aa 37297   II bb 38347
          177  +  II bb 38347   II bb 38347   II bb 38347   II bb 38347   JJ aa 40937
          178  +  JJ aa 40937   JJ aa 40937   JJ aa 40937   JJ bb 42951   JJ bb 42951
          179  +  JJ bb 42951   JJ bb 42951}
    83    180   
    84    181   do_execsql_test 1.2.1 {
    85    182     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
    86         -} {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}
          183  +} {AA aa 4685   AA aa 4685   AA aa 4685   AA aa 4685   AA bb 4685   AA bb 4685
          184  +  AA bb 4685   AA bb 4685   BB aa 12025   BB aa 12025   BB aa 12025
          185  +  BB aa 12025   BB aa 12025   BB aa 12025   BB bb 12025   BB bb 12025
          186  +  BB bb 12025   BB bb 12025   BB bb 12025   BB bb 12025   CC aa 15147
          187  +  CC aa 15147   CC aa 15147   CC aa 15147   CC bb 15147   CC bb 15147
          188  +  DD aa 19179   DD aa 19179   DD aa 19179   DD bb 19179   DD bb 19179
          189  +  DD bb 19179   DD bb 19179   EE aa 21718   EE aa 21718   EE bb 21718
          190  +  EE bb 21718   EE bb 21718   FF aa 27386   FF aa 27386   FF aa 27386
          191  +  FF aa 27386   FF bb 27386   FF bb 27386   FF bb 27386   FF bb 27386
          192  +  FF bb 27386   FF bb 27386   GG aa 31854   GG aa 31854   GG aa 31854
          193  +  GG aa 31854   GG bb 31854   GG bb 31854   GG bb 31854   GG bb 31854
          194  +  HH aa 37297   HH aa 37297   HH aa 37297   HH bb 37297   HH bb 37297
          195  +  HH bb 37297   HH bb 37297   HH bb 37297   HH bb 37297   II aa 40937
          196  +  II aa 40937   II bb 40937   II bb 40937   II bb 40937   II bb 40937
          197  +  II bb 40937   JJ aa 44737   JJ aa 44737   JJ aa 44737   JJ aa 44737
          198  +  JJ bb 44737   JJ bb 44737   JJ bb 44737   JJ bb 44737}
    87    199   
    88    200   do_execsql_test 1.2.2 {
    89    201     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
    90         -} {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}
          202  +} {AA aa 2307   AA aa 2307   AA aa 2307   AA aa 2307   AA bb 4685   AA bb 4685
          203  +  AA bb 4685   AA bb 4685   BB aa 7558   BB aa 7558   BB aa 7558   BB aa 7558
          204  +  BB aa 7558   BB aa 7558   BB bb 12025   BB bb 12025   BB bb 12025
          205  +  BB bb 12025   BB bb 12025   BB bb 12025   CC aa 13979   CC aa 13979
          206  +  CC aa 13979   CC aa 13979   CC bb 15147   CC bb 15147   DD aa 16472
          207  +  DD aa 16472   DD aa 16472   DD bb 19179   DD bb 19179   DD bb 19179
          208  +  DD bb 19179   EE aa 20069   EE aa 20069   EE bb 21718   EE bb 21718
          209  +  EE bb 21718   FF aa 23881   FF aa 23881   FF aa 23881   FF aa 23881
          210  +  FF bb 27386   FF bb 27386   FF bb 27386   FF bb 27386   FF bb 27386
          211  +  FF bb 27386   GG aa 28983   GG aa 28983   GG aa 28983   GG aa 28983
          212  +  GG bb 31854   GG bb 31854   GG bb 31854   GG bb 31854   HH aa 34103
          213  +  HH aa 34103   HH aa 34103   HH bb 37297   HH bb 37297   HH bb 37297
          214  +  HH bb 37297   HH bb 37297   HH bb 37297   II aa 38347   II aa 38347
          215  +  II bb 40937   II bb 40937   II bb 40937   II bb 40937   II bb 40937
          216  +  JJ aa 42951   JJ aa 42951   JJ aa 42951   JJ aa 42951   JJ bb 44737
          217  +  JJ bb 44737   JJ bb 44737   JJ bb 44737}
    91    218   
    92    219   do_execsql_test 1.2.3 {
    93    220     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
    94         -} {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}
          221  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
          222  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
          223  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
          224  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
          225  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
          226  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
          227  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
          228  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
          229  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
          230  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
          231  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
          232  +  JJ bb 73   JJ bb 73   JJ bb 73}
    95    233   
    96    234   do_execsql_test 1.2.4 {
    97    235     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
    98         -} {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}
          236  +} {AA aa 934   AA aa 934   AA aa 934   AA aa 934   AA bb 934   AA bb 934
          237  +  AA bb 934   AA bb 934   BB aa 934   BB aa 934   BB aa 934   BB aa 934
          238  +  BB aa 934   BB aa 934   BB bb 934   BB bb 934   BB bb 934   BB bb 934
          239  +  BB bb 934   BB bb 934   CC aa 934   CC aa 934   CC aa 934   CC aa 934
          240  +  CC bb 934   CC bb 934   DD aa 934   DD aa 934   DD aa 934   DD bb 959
          241  +  DD bb 959   DD bb 959   DD bb 959   EE aa 959   EE aa 959   EE bb 959
          242  +  EE bb 959   EE bb 959   FF aa 959   FF aa 959   FF aa 959   FF aa 959
          243  +  FF bb 959   FF bb 959   FF bb 959   FF bb 959   FF bb 959   FF bb 959
          244  +  GG aa 959   GG aa 959   GG aa 959   GG aa 959   GG bb 959   GG bb 959
          245  +  GG bb 959   GG bb 959   HH aa 979   HH aa 979   HH aa 979   HH bb 979
          246  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
          247  +  II aa 979   II bb 979   II bb 979   II bb 979   II bb 979   II bb 979
          248  +  JJ aa 979   JJ aa 979   JJ aa 979   JJ aa 979   JJ bb 979   JJ bb 979
          249  +  JJ bb 979   JJ bb 979}
    99    250   
   100    251   do_execsql_test 1.2.5 {
   101    252     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
   102         -} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 223   AA bb 223   AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223   BB bb 223   BB bb 223   BB bb 223   BB bb 223   BB bb 223   BB bb 223   CC aa 158   CC aa 158   CC aa 158   CC aa 158   CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 158   DD bb 158   DD bb 158   DD bb 158   EE aa 113   EE aa 113   EE bb 113   EE bb 113   EE bb 113   FF aa 113   FF aa 113   FF aa 113   FF aa 113   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102   GG bb 102   GG bb 102   HH aa 102   HH aa 102   HH aa 102   HH bb 102   HH bb 102   HH bb 102   HH bb 102   HH bb 102   HH bb 102   II aa 102   II aa 102   II bb 102   II bb 102   II bb 102   II bb 102   II bb 102   JJ aa 102   JJ aa 102   JJ aa 102   JJ aa 102   JJ bb 102   JJ bb 102   JJ bb 102   JJ bb 102}
          253  +} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 223   AA bb 223
          254  +  AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223
          255  +  BB aa 223   BB aa 223   BB bb 223   BB bb 223   BB bb 223   BB bb 223
          256  +  BB bb 223   BB bb 223   CC aa 158   CC aa 158   CC aa 158   CC aa 158
          257  +  CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 158
          258  +  DD bb 158   DD bb 158   DD bb 158   EE aa 113   EE aa 113   EE bb 113
          259  +  EE bb 113   EE bb 113   FF aa 113   FF aa 113   FF aa 113   FF aa 113
          260  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
          261  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
          262  +  GG bb 102   GG bb 102   HH aa 102   HH aa 102   HH aa 102   HH bb 102
          263  +  HH bb 102   HH bb 102   HH bb 102   HH bb 102   HH bb 102   II aa 102
          264  +  II aa 102   II bb 102   II bb 102   II bb 102   II bb 102   II bb 102
          265  +  JJ aa 102   JJ aa 102   JJ aa 102   JJ aa 102   JJ bb 102   JJ bb 102
          266  +  JJ bb 102   JJ bb 102}
   103    267   
   104    268   do_execsql_test 1.2.6 {
   105    269     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;
   106         -} {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}
          270  +} {AA aa 3751   AA aa 3774   AA aa 4446   AA aa 4462   AA bb 3815   AA bb 4058
          271  +  AA bb 4113   AA bb 4376   BB aa 11263   BB aa 11365   BB aa 11613
          272  +  BB aa 11626   BB aa 11632   BB aa 11778   BB bb 11185   BB bb 11233
          273  +  BB bb 11239   BB bb 11314   BB bb 11320   BB bb 11392   CC aa 14388
          274  +  CC aa 14540   CC aa 14717   CC aa 14989   CC bb 14325   CC bb 14801
          275  +  DD aa 18334   DD aa 18923   DD aa 18955   DD bb 18220   DD bb 18385
          276  +  DD bb 18463   DD bb 18941   EE aa 20941   EE aa 21605   EE bb 20950
          277  +  EE bb 21089   EE bb 21466   FF aa 26716   FF aa 26719   FF aa 26768
          278  +  FF aa 27178   FF bb 26448   FF bb 26516   FF bb 26660   FF bb 26812
          279  +  FF bb 27091   FF bb 27284   GG aa 31220   GG aa 31374   GG aa 31519
          280  +  GG aa 31706   GG bb 30916   GG bb 30925   GG bb 31010   GG bb 31694
          281  +  HH aa 36318   HH aa 36507   HH aa 36817   HH bb 36334   HH bb 36567
          282  +  HH bb 36614   HH bb 36942   HH bb 36967   HH bb 37164   II aa 40285
          283  +  II aa 40539   II bb 40132   II bb 40266   II bb 40494   II bb 40516
          284  +  II bb 40687   JJ aa 43838   JJ aa 43969   JJ aa 44503   JJ aa 44624
          285  +  JJ bb 43898   JJ bb 44383   JJ bb 44401   JJ bb 44480}
   107    286   
   108    287   do_execsql_test 1.2.7 {
   109    288     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;
   110         -} {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}
          289  +} {AA aa 1373   AA aa 1396   AA aa 2068   AA aa 2084   AA bb 3815   AA bb 4058
          290  +  AA bb 4113   AA bb 4376   BB aa 6796   BB aa 6898   BB aa 7146   BB aa 7159
          291  +  BB aa 7165   BB aa 7311   BB bb 11185   BB bb 11233   BB bb 11239
          292  +  BB bb 11314   BB bb 11320   BB bb 11392   CC aa 13220   CC aa 13372
          293  +  CC aa 13549   CC aa 13821   CC bb 14325   CC bb 14801   DD aa 15627
          294  +  DD aa 16216   DD aa 16248   DD bb 18220   DD bb 18385   DD bb 18463
          295  +  DD bb 18941   EE aa 19292   EE aa 19956   EE bb 20950   EE bb 21089
          296  +  EE bb 21466   FF aa 23211   FF aa 23214   FF aa 23263   FF aa 23673
          297  +  FF bb 26448   FF bb 26516   FF bb 26660   FF bb 26812   FF bb 27091
          298  +  FF bb 27284   GG aa 28349   GG aa 28503   GG aa 28648   GG aa 28835
          299  +  GG bb 30916   GG bb 30925   GG bb 31010   GG bb 31694   HH aa 33124
          300  +  HH aa 33313   HH aa 33623   HH bb 36334   HH bb 36567   HH bb 36614
          301  +  HH bb 36942   HH bb 36967   HH bb 37164   II aa 37695   II aa 37949
          302  +  II bb 40132   II bb 40266   II bb 40494   II bb 40516   II bb 40687
          303  +  JJ aa 42052   JJ aa 42183   JJ aa 42717   JJ aa 42838   JJ bb 43898
          304  +  JJ bb 44383   JJ bb 44401   JJ bb 44480}
   111    305   
   112    306   do_execsql_test 1.3.1 {
   113    307     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   114         -} {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}
          308  +} {AA aa 12025   AA aa 12025   AA aa 12025   AA aa 12025   AA bb 12025
          309  +  AA bb 12025   AA bb 12025   AA bb 12025   BB aa 15147   BB aa 15147
          310  +  BB aa 15147   BB aa 15147   BB aa 15147   BB aa 15147   BB bb 15147
          311  +  BB bb 15147   BB bb 15147   BB bb 15147   BB bb 15147   BB bb 15147
          312  +  CC aa 19179   CC aa 19179   CC aa 19179   CC aa 19179   CC bb 19179
          313  +  CC bb 19179   DD aa 21718   DD aa 21718   DD aa 21718   DD bb 21718
          314  +  DD bb 21718   DD bb 21718   DD bb 21718   EE aa 27386   EE aa 27386
          315  +  EE bb 27386   EE bb 27386   EE bb 27386   FF aa 31854   FF aa 31854
          316  +  FF aa 31854   FF aa 31854   FF bb 31854   FF bb 31854   FF bb 31854
          317  +  FF bb 31854   FF bb 31854   FF bb 31854   GG aa 37297   GG aa 37297
          318  +  GG aa 37297   GG aa 37297   GG bb 37297   GG bb 37297   GG bb 37297
          319  +  GG bb 37297   HH aa 40937   HH aa 40937   HH aa 40937   HH bb 40937
          320  +  HH bb 40937   HH bb 40937   HH bb 40937   HH bb 40937   HH bb 40937
          321  +  II aa 44737   II aa 44737   II bb 44737   II bb 44737   II bb 44737
          322  +  II bb 44737   II bb 44737   JJ aa 44737   JJ aa 44737   JJ aa 44737
          323  +  JJ aa 44737   JJ bb 44737   JJ bb 44737   JJ bb 44737   JJ bb 44737}
   115    324   
   116    325   do_execsql_test 1.3.2 {
   117    326     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   118         -} {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}
          327  +} {AA aa 4685   AA aa 4685   AA aa 4685   AA aa 4685   AA bb 7558   AA bb 7558
          328  +  AA bb 7558   AA bb 7558   BB aa 12025   BB aa 12025   BB aa 12025
          329  +  BB aa 12025   BB aa 12025   BB aa 12025   BB bb 13979   BB bb 13979
          330  +  BB bb 13979   BB bb 13979   BB bb 13979   BB bb 13979   CC aa 15147
          331  +  CC aa 15147   CC aa 15147   CC aa 15147   CC bb 16472   CC bb 16472
          332  +  DD aa 19179   DD aa 19179   DD aa 19179   DD bb 20069   DD bb 20069
          333  +  DD bb 20069   DD bb 20069   EE aa 21718   EE aa 21718   EE bb 23881
          334  +  EE bb 23881   EE bb 23881   FF aa 27386   FF aa 27386   FF aa 27386
          335  +  FF aa 27386   FF bb 28983   FF bb 28983   FF bb 28983   FF bb 28983
          336  +  FF bb 28983   FF bb 28983   GG aa 31854   GG aa 31854   GG aa 31854
          337  +  GG aa 31854   GG bb 34103   GG bb 34103   GG bb 34103   GG bb 34103
          338  +  HH aa 37297   HH aa 37297   HH aa 37297   HH bb 38347   HH bb 38347
          339  +  HH bb 38347   HH bb 38347   HH bb 38347   HH bb 38347   II aa 40937
          340  +  II aa 40937   II bb 42951   II bb 42951   II bb 42951   II bb 42951
          341  +  II bb 42951   JJ aa 44737   JJ aa 44737   JJ aa 44737   JJ aa 44737
          342  +  JJ bb 44737   JJ bb 44737   JJ bb 44737   JJ bb 44737}
   119    343   
   120    344   do_execsql_test 1.3.3 {
   121    345     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   122         -} {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}
          346  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
          347  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
          348  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
          349  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
          350  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
          351  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
          352  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
          353  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
          354  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
          355  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
          356  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
          357  +  JJ bb 73   JJ bb 73   JJ bb 73}
   123    358   
   124    359   do_execsql_test 1.3.4 {
   125    360     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   126         -} {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}
          361  +} {AA aa 934   AA aa 934   AA aa 934   AA aa 934   AA bb 934   AA bb 934
          362  +  AA bb 934   AA bb 934   BB aa 934   BB aa 934   BB aa 934   BB aa 934
          363  +  BB aa 934   BB aa 934   BB bb 934   BB bb 934   BB bb 934   BB bb 934
          364  +  BB bb 934   BB bb 934   CC aa 934   CC aa 934   CC aa 934   CC aa 934
          365  +  CC bb 934   CC bb 934   DD aa 959   DD aa 959   DD aa 959   DD bb 959
          366  +  DD bb 959   DD bb 959   DD bb 959   EE aa 959   EE aa 959   EE bb 959
          367  +  EE bb 959   EE bb 959   FF aa 959   FF aa 959   FF aa 959   FF aa 959
          368  +  FF bb 959   FF bb 959   FF bb 959   FF bb 959   FF bb 959   FF bb 959
          369  +  GG aa 959   GG aa 959   GG aa 959   GG aa 959   GG bb 979   GG bb 979
          370  +  GG bb 979   GG bb 979   HH aa 979   HH aa 979   HH aa 979   HH bb 979
          371  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
          372  +  II aa 979   II bb 979   II bb 979   II bb 979   II bb 979   II bb 979
          373  +  JJ aa 979   JJ aa 979   JJ aa 979   JJ aa 979   JJ bb 979   JJ bb 979
          374  +  JJ bb 979   JJ bb 979}
   127    375   
   128    376   do_execsql_test 1.3.5 {
   129    377     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   130         -} {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}
          378  +} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 223   AA bb 223
          379  +  AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223
          380  +  BB aa 223   BB aa 223   BB bb 158   BB bb 158   BB bb 158   BB bb 158
          381  +  BB bb 158   BB bb 158   CC aa 158   CC aa 158   CC aa 158   CC aa 158
          382  +  CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 113
          383  +  DD bb 113   DD bb 113   DD bb 113   EE aa 113   EE aa 113   EE bb 113
          384  +  EE bb 113   EE bb 113   FF aa 102   FF aa 102   FF aa 102   FF aa 102
          385  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
          386  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
          387  +  GG bb 102   GG bb 102   HH aa 102   HH aa 102   HH aa 102   HH bb 102
          388  +  HH bb 102   HH bb 102   HH bb 102   HH bb 102   HH bb 102   II aa 102
          389  +  II aa 102   II bb 102   II bb 102   II bb 102   II bb 102   II bb 102
          390  +  JJ aa 102   JJ aa 102   JJ aa 102   JJ aa 102   JJ bb 102   JJ bb 102
          391  +  JJ bb 102   JJ bb 102}
   131    392   
   132    393   do_execsql_test 1.3.6 {
   133    394     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;
   134         -} {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}
          395  +} {AA aa 11091   AA aa 11114   AA aa 11786   AA aa 11802   AA bb 11155
          396  +  AA bb 11398   AA bb 11453   AA bb 11716   BB aa 14385   BB aa 14487
          397  +  BB aa 14735   BB aa 14748   BB aa 14754   BB aa 14900   BB bb 14307
          398  +  BB bb 14355   BB bb 14361   BB bb 14436   BB bb 14442   BB bb 14514
          399  +  CC aa 18420   CC aa 18572   CC aa 18749   CC aa 19021   CC bb 18357
          400  +  CC bb 18833   DD aa 20873   DD aa 21462   DD aa 21494   DD bb 20759
          401  +  DD bb 20924   DD bb 21002   DD bb 21480   EE aa 26609   EE aa 27273
          402  +  EE bb 26618   EE bb 26757   EE bb 27134   FF aa 31184   FF aa 31187
          403  +  FF aa 31236   FF aa 31646   FF bb 30916   FF bb 30984   FF bb 31128
          404  +  FF bb 31280   FF bb 31559   FF bb 31752   GG aa 36663   GG aa 36817
          405  +  GG aa 36962   GG aa 37149   GG bb 36359   GG bb 36368   GG bb 36453
          406  +  GG bb 37137   HH aa 39958   HH aa 40147   HH aa 40457   HH bb 39974
          407  +  HH bb 40207   HH bb 40254   HH bb 40582   HH bb 40607   HH bb 40804
          408  +  II aa 44085   II aa 44339   II bb 43932   II bb 44066   II bb 44294
          409  +  II bb 44316   II bb 44487   JJ aa 43838   JJ aa 43969   JJ aa 44503
          410  +  JJ aa 44624   JJ bb 43898   JJ bb 44383   JJ bb 44401   JJ bb 44480}
   135    411   
   136    412   do_execsql_test 1.3.7 {
   137    413     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;
   138         -} {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}
          414  +} {AA aa 3751   AA aa 3774   AA aa 4446   AA aa 4462   AA bb 6688   AA bb 6931
          415  +  AA bb 6986   AA bb 7249   BB aa 11263   BB aa 11365   BB aa 11613
          416  +  BB aa 11626   BB aa 11632   BB aa 11778   BB bb 13139   BB bb 13187
          417  +  BB bb 13193   BB bb 13268   BB bb 13274   BB bb 13346   CC aa 14388
          418  +  CC aa 14540   CC aa 14717   CC aa 14989   CC bb 15650   CC bb 16126
          419  +  DD aa 18334   DD aa 18923   DD aa 18955   DD bb 19110   DD bb 19275
          420  +  DD bb 19353   DD bb 19831   EE aa 20941   EE aa 21605   EE bb 23113
          421  +  EE bb 23252   EE bb 23629   FF aa 26716   FF aa 26719   FF aa 26768
          422  +  FF aa 27178   FF bb 28045   FF bb 28113   FF bb 28257   FF bb 28409
          423  +  FF bb 28688   FF bb 28881   GG aa 31220   GG aa 31374   GG aa 31519
          424  +  GG aa 31706   GG bb 33165   GG bb 33174   GG bb 33259   GG bb 33943
          425  +  HH aa 36318   HH aa 36507   HH aa 36817   HH bb 37384   HH bb 37617
          426  +  HH bb 37664   HH bb 37992   HH bb 38017   HH bb 38214   II aa 40285
          427  +  II aa 40539   II bb 42146   II bb 42280   II bb 42508   II bb 42530
          428  +  II bb 42701   JJ aa 43838   JJ aa 43969   JJ aa 44503   JJ aa 44624
          429  +  JJ bb 43898   JJ bb 44383   JJ bb 44401   JJ bb 44480}
   139    430   
   140    431   do_execsql_test 1.4.1 {
   141    432     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   142         -} {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}
          433  +} {AA aa 44737   AA aa 44737   AA aa 44737   AA aa 44737   AA bb 44737
          434  +  AA bb 44737   AA bb 44737   AA bb 44737   BB aa 44737   BB aa 44737
          435  +  BB aa 44737   BB aa 44737   BB aa 44737   BB aa 44737   BB bb 44737
          436  +  BB bb 44737   BB bb 44737   BB bb 44737   BB bb 44737   BB bb 44737
          437  +  CC aa 44737   CC aa 44737   CC aa 44737   CC aa 44737   CC bb 44737
          438  +  CC bb 44737   DD aa 44737   DD aa 44737   DD aa 44737   DD bb 44737
          439  +  DD bb 44737   DD bb 44737   DD bb 44737   EE aa 44737   EE aa 44737
          440  +  EE bb 44737   EE bb 44737   EE bb 44737   FF aa 44737   FF aa 44737
          441  +  FF aa 44737   FF aa 44737   FF bb 44737   FF bb 44737   FF bb 44737
          442  +  FF bb 44737   FF bb 44737   FF bb 44737   GG aa 44737   GG aa 44737
          443  +  GG aa 44737   GG aa 44737   GG bb 44737   GG bb 44737   GG bb 44737
          444  +  GG bb 44737   HH aa 44737   HH aa 44737   HH aa 44737   HH bb 44737
          445  +  HH bb 44737   HH bb 44737   HH bb 44737   HH bb 44737   HH bb 44737
          446  +  II aa 44737   II aa 44737   II bb 44737   II bb 44737   II bb 44737
          447  +  II bb 44737   II bb 44737   JJ aa 44737   JJ aa 44737   JJ aa 44737
          448  +  JJ aa 44737   JJ bb 44737   JJ bb 44737   JJ bb 44737   JJ bb 44737}
   143    449   
   144    450   do_execsql_test 1.4.2 {
   145    451     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   146         -} {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}
          452  +} {AA aa 44737   AA aa 44737   AA aa 44737   AA aa 44737   AA bb 44737
          453  +  AA bb 44737   AA bb 44737   AA bb 44737   BB aa 44737   BB aa 44737
          454  +  BB aa 44737   BB aa 44737   BB aa 44737   BB aa 44737   BB bb 44737
          455  +  BB bb 44737   BB bb 44737   BB bb 44737   BB bb 44737   BB bb 44737
          456  +  CC aa 44737   CC aa 44737   CC aa 44737   CC aa 44737   CC bb 44737
          457  +  CC bb 44737   DD aa 44737   DD aa 44737   DD aa 44737   DD bb 44737
          458  +  DD bb 44737   DD bb 44737   DD bb 44737   EE aa 44737   EE aa 44737
          459  +  EE bb 44737   EE bb 44737   EE bb 44737   FF aa 44737   FF aa 44737
          460  +  FF aa 44737   FF aa 44737   FF bb 44737   FF bb 44737   FF bb 44737
          461  +  FF bb 44737   FF bb 44737   FF bb 44737   GG aa 44737   GG aa 44737
          462  +  GG aa 44737   GG aa 44737   GG bb 44737   GG bb 44737   GG bb 44737
          463  +  GG bb 44737   HH aa 44737   HH aa 44737   HH aa 44737   HH bb 44737
          464  +  HH bb 44737   HH bb 44737   HH bb 44737   HH bb 44737   HH bb 44737
          465  +  II aa 44737   II aa 44737   II bb 44737   II bb 44737   II bb 44737
          466  +  II bb 44737   II bb 44737   JJ aa 44737   JJ aa 44737   JJ aa 44737
          467  +  JJ aa 44737   JJ bb 44737   JJ bb 44737   JJ bb 44737   JJ bb 44737}
   147    468   
   148    469   do_execsql_test 1.4.3 {
   149    470     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   150         -} {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}
          471  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
          472  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
          473  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
          474  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
          475  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
          476  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
          477  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
          478  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
          479  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
          480  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
          481  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
          482  +  JJ bb 73   JJ bb 73   JJ bb 73}
   151    483   
   152    484   do_execsql_test 1.4.4 {
   153    485     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   154         -} {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}
          486  +} {AA aa 979   AA aa 979   AA aa 979   AA aa 979   AA bb 979   AA bb 979
          487  +  AA bb 979   AA bb 979   BB aa 979   BB aa 979   BB aa 979   BB aa 979
          488  +  BB aa 979   BB aa 979   BB bb 979   BB bb 979   BB bb 979   BB bb 979
          489  +  BB bb 979   BB bb 979   CC aa 979   CC aa 979   CC aa 979   CC aa 979
          490  +  CC bb 979   CC bb 979   DD aa 979   DD aa 979   DD aa 979   DD bb 979
          491  +  DD bb 979   DD bb 979   DD bb 979   EE aa 979   EE aa 979   EE bb 979
          492  +  EE bb 979   EE bb 979   FF aa 979   FF aa 979   FF aa 979   FF aa 979
          493  +  FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979
          494  +  GG aa 979   GG aa 979   GG aa 979   GG aa 979   GG bb 979   GG bb 979
          495  +  GG bb 979   GG bb 979   HH aa 979   HH aa 979   HH aa 979   HH bb 979
          496  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
          497  +  II aa 979   II bb 979   II bb 979   II bb 979   II bb 979   II bb 979
          498  +  JJ aa 979   JJ aa 979   JJ aa 979   JJ aa 979   JJ bb 979   JJ bb 979
          499  +  JJ bb 979   JJ bb 979}
   155    500   
   156    501   do_execsql_test 1.4.5 {
   157    502     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   158         -} {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}
          503  +} {AA aa 102   AA aa 102   AA aa 102   AA aa 102   AA bb 102   AA bb 102
          504  +  AA bb 102   AA bb 102   BB aa 102   BB aa 102   BB aa 102   BB aa 102
          505  +  BB aa 102   BB aa 102   BB bb 102   BB bb 102   BB bb 102   BB bb 102
          506  +  BB bb 102   BB bb 102   CC aa 102   CC aa 102   CC aa 102   CC aa 102
          507  +  CC bb 102   CC bb 102   DD aa 102   DD aa 102   DD aa 102   DD bb 102
          508  +  DD bb 102   DD bb 102   DD bb 102   EE aa 102   EE aa 102   EE bb 102
          509  +  EE bb 102   EE bb 102   FF aa 102   FF aa 102   FF aa 102   FF aa 102
          510  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
          511  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
          512  +  GG bb 102   GG bb 102   HH aa 102   HH aa 102   HH aa 102   HH bb 102
          513  +  HH bb 102   HH bb 102   HH bb 102   HH bb 102   HH bb 102   II aa 102
          514  +  II aa 102   II bb 102   II bb 102   II bb 102   II bb 102   II bb 102
          515  +  JJ aa 102   JJ aa 102   JJ aa 102   JJ aa 102   JJ bb 102   JJ bb 102
          516  +  JJ bb 102   JJ bb 102}
   159    517   
   160    518   do_execsql_test 1.4.6 {
   161    519     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;
   162         -} {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}
          520  +} {AA aa 43803   AA aa 43826   AA aa 44498   AA aa 44514   AA bb 43867
          521  +  AA bb 44110   AA bb 44165   AA bb 44428   BB aa 43975   BB aa 44077
          522  +  BB aa 44325   BB aa 44338   BB aa 44344   BB aa 44490   BB bb 43897
          523  +  BB bb 43945   BB bb 43951   BB bb 44026   BB bb 44032   BB bb 44104
          524  +  CC aa 43978   CC aa 44130   CC aa 44307   CC aa 44579   CC bb 43915
          525  +  CC bb 44391   DD aa 43892   DD aa 44481   DD aa 44513   DD bb 43778
          526  +  DD bb 43943   DD bb 44021   DD bb 44499   EE aa 43960   EE aa 44624
          527  +  EE bb 43969   EE bb 44108   EE bb 44485   FF aa 44067   FF aa 44070
          528  +  FF aa 44119   FF aa 44529   FF bb 43799   FF bb 43867   FF bb 44011
          529  +  FF bb 44163   FF bb 44442   FF bb 44635   GG aa 44103   GG aa 44257
          530  +  GG aa 44402   GG aa 44589   GG bb 43799   GG bb 43808   GG bb 43893
          531  +  GG bb 44577   HH aa 43758   HH aa 43947   HH aa 44257   HH bb 43774
          532  +  HH bb 44007   HH bb 44054   HH bb 44382   HH bb 44407   HH bb 44604
          533  +  II aa 44085   II aa 44339   II bb 43932   II bb 44066   II bb 44294
          534  +  II bb 44316   II bb 44487   JJ aa 43838   JJ aa 43969   JJ aa 44503
          535  +  JJ aa 44624   JJ bb 43898   JJ bb 44383   JJ bb 44401   JJ bb 44480}
   163    536   
   164    537   do_execsql_test 1.4.7 {
   165    538     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;
   166         -} {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}
          539  +} {AA aa 43803   AA aa 43826   AA aa 44498   AA aa 44514   AA bb 43867
          540  +  AA bb 44110   AA bb 44165   AA bb 44428   BB aa 43975   BB aa 44077
          541  +  BB aa 44325   BB aa 44338   BB aa 44344   BB aa 44490   BB bb 43897
          542  +  BB bb 43945   BB bb 43951   BB bb 44026   BB bb 44032   BB bb 44104
          543  +  CC aa 43978   CC aa 44130   CC aa 44307   CC aa 44579   CC bb 43915
          544  +  CC bb 44391   DD aa 43892   DD aa 44481   DD aa 44513   DD bb 43778
          545  +  DD bb 43943   DD bb 44021   DD bb 44499   EE aa 43960   EE aa 44624
          546  +  EE bb 43969   EE bb 44108   EE bb 44485   FF aa 44067   FF aa 44070
          547  +  FF aa 44119   FF aa 44529   FF bb 43799   FF bb 43867   FF bb 44011
          548  +  FF bb 44163   FF bb 44442   FF bb 44635   GG aa 44103   GG aa 44257
          549  +  GG aa 44402   GG aa 44589   GG bb 43799   GG bb 43808   GG bb 43893
          550  +  GG bb 44577   HH aa 43758   HH aa 43947   HH aa 44257   HH bb 43774
          551  +  HH bb 44007   HH bb 44054   HH bb 44382   HH bb 44407   HH bb 44604
          552  +  II aa 44085   II aa 44339   II bb 43932   II bb 44066   II bb 44294
          553  +  II bb 44316   II bb 44487   JJ aa 43838   JJ aa 43969   JJ aa 44503
          554  +  JJ aa 44624   JJ bb 43898   JJ bb 44383   JJ bb 44401   JJ bb 44480}
   167    555   
   168    556   do_execsql_test 1.5.1 {
   169    557     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 1 PRECEDING         AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   170         -} {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 {}}
          558  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          559  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
          560  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
          561  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
          562  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
          563  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
          564  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
          565  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
          566  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
          567  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
          568  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
          569  +  JJ bb {}   JJ bb {}   JJ bb {}}
   171    570   
   172    571   do_execsql_test 1.5.2 {
   173    572     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 PRECEDING         AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   174         -} {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 {}}
          573  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          574  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
          575  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
          576  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
          577  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
          578  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
          579  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
          580  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
          581  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
          582  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
          583  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
          584  +  JJ bb {}   JJ bb {}   JJ bb {}}
   175    585   
   176    586   do_execsql_test 1.5.3 {
   177    587     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 1 PRECEDING         AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   178         -} {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}
          588  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
          589  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
          590  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
          591  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
          592  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
          593  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
          594  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
          595  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
          596  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
          597  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
          598  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
          599  +  JJ bb 73   JJ bb 73   JJ bb 73}
   179    600   
   180    601   do_execsql_test 1.5.4 {
   181    602     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 PRECEDING         AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   182         -} {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 {}}
          603  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          604  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
          605  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
          606  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
          607  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
          608  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
          609  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
          610  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
          611  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
          612  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
          613  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
          614  +  JJ bb {}   JJ bb {}   JJ bb {}}
   183    615   
   184    616   do_execsql_test 1.5.5 {
   185    617     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 PRECEDING         AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   186         -} {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 {}}
          618  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          619  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
          620  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
          621  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
          622  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
          623  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
          624  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
          625  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
          626  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
          627  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
          628  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
          629  +  JJ bb {}   JJ bb {}   JJ bb {}}
   187    630   
   188    631   do_execsql_test 1.5.6 {
   189    632     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;
   190         -} {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 {}}
          633  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          634  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
          635  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
          636  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
          637  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
          638  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
          639  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
          640  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
          641  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
          642  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
          643  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
          644  +  JJ bb {}   JJ bb {}   JJ bb {}}
   191    645   
   192    646   do_execsql_test 1.5.7 {
   193    647     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;
   194         -} {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 {}}
          648  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          649  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
          650  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
          651  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
          652  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
          653  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
          654  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
          655  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
          656  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
          657  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
          658  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
          659  +  JJ bb {}   JJ bb {}   JJ bb {}}
   195    660   
   196    661   do_execsql_test 1.6.1 {
   197    662     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 2 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   198         -} {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}
          663  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          664  +  AA bb {}   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          665  +  BB aa 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685
          666  +  BB bb 4685   CC aa 12025   CC aa 12025   CC aa 12025   CC aa 12025
          667  +  CC bb 12025   CC bb 12025   DD aa 10462   DD aa 10462   DD aa 10462
          668  +  DD bb 10462   DD bb 10462   DD bb 10462   DD bb 10462   EE aa 7154
          669  +  EE aa 7154   EE bb 7154   EE bb 7154   EE bb 7154   FF aa 6571   FF aa 6571
          670  +  FF aa 6571   FF aa 6571   FF bb 6571   FF bb 6571   FF bb 6571   FF bb 6571
          671  +  FF bb 6571   FF bb 6571   GG aa 8207   GG aa 8207   GG aa 8207   GG aa 8207
          672  +  GG bb 8207   GG bb 8207   GG bb 8207   GG bb 8207   HH aa 10136
          673  +  HH aa 10136   HH aa 10136   HH bb 10136   HH bb 10136   HH bb 10136
          674  +  HH bb 10136   HH bb 10136   HH bb 10136   II aa 9911   II aa 9911
          675  +  II bb 9911   II bb 9911   II bb 9911   II bb 9911   II bb 9911   JJ aa 9083
          676  +  JJ aa 9083   JJ aa 9083   JJ aa 9083   JJ bb 9083   JJ bb 9083   JJ bb 9083
          677  +  JJ bb 9083}
   199    678   
   200    679   do_execsql_test 1.6.2 {
   201    680     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   202         -} {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}
          681  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 2307   AA bb 2307
          682  +  AA bb 2307   AA bb 2307   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          683  +  BB aa 4685   BB aa 4685   BB bb 5251   BB bb 5251   BB bb 5251   BB bb 5251
          684  +  BB bb 5251   BB bb 5251   CC aa 7340   CC aa 7340   CC aa 7340   CC aa 7340
          685  +  CC bb 6421   CC bb 6421   DD aa 3122   DD aa 3122   DD aa 3122   DD bb 2493
          686  +  DD bb 2493   DD bb 2493   DD bb 2493   EE aa 4032   EE aa 4032   EE bb 3597
          687  +  EE bb 3597   EE bb 3597   FF aa 2539   FF aa 2539   FF aa 2539   FF aa 2539
          688  +  FF bb 3812   FF bb 3812   FF bb 3812   FF bb 3812   FF bb 3812   FF bb 3812
          689  +  GG aa 5668   GG aa 5668   GG aa 5668   GG aa 5668   GG bb 5102   GG bb 5102
          690  +  GG bb 5102   GG bb 5102   HH aa 4468   HH aa 4468   HH aa 4468   HH bb 5120
          691  +  HH bb 5120   HH bb 5120   HH bb 5120   HH bb 5120   HH bb 5120   II aa 5443
          692  +  II aa 5443   II bb 4244   II bb 4244   II bb 4244   II bb 4244   II bb 4244
          693  +  JJ aa 3640   JJ aa 3640   JJ aa 3640   JJ aa 3640   JJ bb 4604   JJ bb 4604
          694  +  JJ bb 4604   JJ bb 4604}
   203    695   
   204    696   do_execsql_test 1.6.3 {
   205    697     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 2 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   206         -} {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}
          698  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
          699  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
          700  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
          701  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
          702  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
          703  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
          704  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
          705  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
          706  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
          707  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
          708  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
          709  +  JJ bb 73   JJ bb 73   JJ bb 73}
   207    710   
   208    711   do_execsql_test 1.6.4 {
   209    712     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   210         -} {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}
          713  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 934   AA bb 934
          714  +  AA bb 934   AA bb 934   BB aa 934   BB aa 934   BB aa 934   BB aa 934
          715  +  BB aa 934   BB aa 934   BB bb 870   BB bb 870   BB bb 870   BB bb 870
          716  +  BB bb 870   BB bb 870   CC aa 840   CC aa 840   CC aa 840   CC aa 840
          717  +  CC bb 840   CC bb 840   DD aa 822   DD aa 822   DD aa 822   DD bb 845
          718  +  DD bb 845   DD bb 845   DD bb 845   EE aa 959   EE aa 959   EE bb 959
          719  +  EE bb 959   EE bb 959   FF aa 777   FF aa 777   FF aa 777   FF aa 777
          720  +  FF bb 768   FF bb 768   FF bb 768   FF bb 768   FF bb 768   FF bb 768
          721  +  GG aa 938   GG aa 938   GG aa 938   GG aa 938   GG bb 938   GG bb 938
          722  +  GG bb 938   GG bb 938   HH aa 938   HH aa 938   HH aa 938   HH bb 979
          723  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
          724  +  II aa 979   II bb 963   II bb 963   II bb 963   II bb 963   II bb 963
          725  +  JJ aa 805   JJ aa 805   JJ aa 805   JJ aa 805   JJ bb 899   JJ bb 899
          726  +  JJ bb 899   JJ bb 899}
   211    727   
   212    728   do_execsql_test 1.6.5 {
   213    729     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   214         -} {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}
          730  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 223   AA bb 223
          731  +  AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223
          732  +  BB aa 223   BB aa 223   BB bb 247   BB bb 247   BB bb 247   BB bb 247
          733  +  BB bb 247   BB bb 247   CC aa 247   CC aa 247   CC aa 247   CC aa 247
          734  +  CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 224
          735  +  DD bb 224   DD bb 224   DD bb 224   EE aa 224   EE aa 224   EE bb 113
          736  +  EE bb 113   EE bb 113   FF aa 113   FF aa 113   FF aa 113   FF aa 113
          737  +  FF bb 208   FF bb 208   FF bb 208   FF bb 208   FF bb 208   FF bb 208
          738  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
          739  +  GG bb 102   GG bb 102   HH aa 148   HH aa 148   HH aa 148   HH bb 160
          740  +  HH bb 160   HH bb 160   HH bb 160   HH bb 160   HH bb 160   II aa 133
          741  +  II aa 133   II bb 133   II bb 133   II bb 133   II bb 133   II bb 133
          742  +  JJ aa 250   JJ aa 250   JJ aa 250   JJ aa 250   JJ bb 113   JJ bb 113
          743  +  JJ bb 113   JJ bb 113}
   215    744   
   216    745   do_execsql_test 1.6.6 {
   217    746     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;
   218         -} {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}
          747  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          748  +  AA bb {}   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          749  +  BB aa 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685
          750  +  BB bb 4685   CC aa 12025   CC aa 12025   CC aa 12025   CC aa 12025
          751  +  CC bb 12025   CC bb 12025   DD aa 10462   DD aa 10462   DD aa 10462
          752  +  DD bb 10462   DD bb 10462   DD bb 10462   DD bb 10462   EE aa 7154
          753  +  EE aa 7154   EE bb 7154   EE bb 7154   EE bb 7154   FF aa 6571   FF aa 6571
          754  +  FF aa 6571   FF aa 6571   FF bb 6571   FF bb 6571   FF bb 6571   FF bb 6571
          755  +  FF bb 6571   FF bb 6571   GG aa 8207   GG aa 8207   GG aa 8207   GG aa 8207
          756  +  GG bb 8207   GG bb 8207   GG bb 8207   GG bb 8207   HH aa 10136
          757  +  HH aa 10136   HH aa 10136   HH bb 10136   HH bb 10136   HH bb 10136
          758  +  HH bb 10136   HH bb 10136   HH bb 10136   II aa 9911   II aa 9911
          759  +  II bb 9911   II bb 9911   II bb 9911   II bb 9911   II bb 9911   JJ aa 9083
          760  +  JJ aa 9083   JJ aa 9083   JJ aa 9083   JJ bb 9083   JJ bb 9083   JJ bb 9083
          761  +  JJ bb 9083}
   219    762   
   220    763   do_execsql_test 1.6.7 {
   221    764     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;
   222         -} {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}
          765  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 2307   AA bb 2307
          766  +  AA bb 2307   AA bb 2307   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          767  +  BB aa 4685   BB aa 4685   BB bb 5251   BB bb 5251   BB bb 5251   BB bb 5251
          768  +  BB bb 5251   BB bb 5251   CC aa 7340   CC aa 7340   CC aa 7340   CC aa 7340
          769  +  CC bb 6421   CC bb 6421   DD aa 3122   DD aa 3122   DD aa 3122   DD bb 2493
          770  +  DD bb 2493   DD bb 2493   DD bb 2493   EE aa 4032   EE aa 4032   EE bb 3597
          771  +  EE bb 3597   EE bb 3597   FF aa 2539   FF aa 2539   FF aa 2539   FF aa 2539
          772  +  FF bb 3812   FF bb 3812   FF bb 3812   FF bb 3812   FF bb 3812   FF bb 3812
          773  +  GG aa 5668   GG aa 5668   GG aa 5668   GG aa 5668   GG bb 5102   GG bb 5102
          774  +  GG bb 5102   GG bb 5102   HH aa 4468   HH aa 4468   HH aa 4468   HH bb 5120
          775  +  HH bb 5120   HH bb 5120   HH bb 5120   HH bb 5120   HH bb 5120   II aa 5443
          776  +  II aa 5443   II bb 4244   II bb 4244   II bb 4244   II bb 4244   II bb 4244
          777  +  JJ aa 3640   JJ aa 3640   JJ aa 3640   JJ aa 3640   JJ bb 4604   JJ bb 4604
          778  +  JJ bb 4604   JJ bb 4604}
   223    779   
   224    780   do_execsql_test 1.7.1 {
   225    781     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 3 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   226         -} {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}
          782  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          783  +  AA bb {}   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          784  +  BB aa 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685
          785  +  BB bb 4685   CC aa 12025   CC aa 12025   CC aa 12025   CC aa 12025
          786  +  CC bb 12025   CC bb 12025   DD aa 15147   DD aa 15147   DD aa 15147
          787  +  DD bb 15147   DD bb 15147   DD bb 15147   DD bb 15147   EE aa 14494
          788  +  EE aa 14494   EE bb 14494   EE bb 14494   EE bb 14494   FF aa 9693
          789  +  FF aa 9693   FF aa 9693   FF aa 9693   FF bb 9693   FF bb 9693   FF bb 9693
          790  +  FF bb 9693   FF bb 9693   FF bb 9693   GG aa 12239   GG aa 12239
          791  +  GG aa 12239   GG aa 12239   GG bb 12239   GG bb 12239   GG bb 12239
          792  +  GG bb 12239   HH aa 12675   HH aa 12675   HH aa 12675   HH bb 12675
          793  +  HH bb 12675   HH bb 12675   HH bb 12675   HH bb 12675   HH bb 12675
          794  +  II aa 15579   II aa 15579   II bb 15579   II bb 15579   II bb 15579
          795  +  II bb 15579   II bb 15579   JJ aa 13551   JJ aa 13551   JJ aa 13551
          796  +  JJ aa 13551   JJ bb 13551   JJ bb 13551   JJ bb 13551   JJ bb 13551}
   227    797   
   228    798   do_execsql_test 1.7.2 {
   229    799     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   230         -} {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}
          800  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 2307   AA bb 2307
          801  +  AA bb 2307   AA bb 2307   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          802  +  BB aa 4685   BB aa 4685   BB bb 7558   BB bb 7558   BB bb 7558   BB bb 7558
          803  +  BB bb 7558   BB bb 7558   CC aa 9718   CC aa 9718   CC aa 9718   CC aa 9718
          804  +  CC bb 9294   CC bb 9294   DD aa 7589   DD aa 7589   DD aa 7589   DD bb 4447
          805  +  DD bb 4447   DD bb 4447   DD bb 4447   EE aa 5200   EE aa 5200   EE bb 4922
          806  +  EE bb 4922   EE bb 4922   FF aa 5246   FF aa 5246   FF aa 5246   FF aa 5246
          807  +  FF bb 4702   FF bb 4702   FF bb 4702   FF bb 4702   FF bb 4702   FF bb 4702
          808  +  GG aa 7317   GG aa 7317   GG aa 7317   GG aa 7317   GG bb 7265   GG bb 7265
          809  +  GG bb 7265   GG bb 7265   HH aa 7973   HH aa 7973   HH aa 7973   HH bb 6717
          810  +  HH bb 6717   HH bb 6717   HH bb 6717   HH bb 6717   HH bb 6717   II aa 8314
          811  +  II aa 8314   II bb 6493   II bb 6493   II bb 6493   II bb 6493   II bb 6493
          812  +  JJ aa 6834   JJ aa 6834   JJ aa 6834   JJ aa 6834   JJ bb 5654   JJ bb 5654
          813  +  JJ bb 5654   JJ bb 5654}
   231    814   
   232    815   do_execsql_test 1.7.3 {
   233    816     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 3 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   234         -} {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}
          817  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
          818  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
          819  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
          820  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
          821  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
          822  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
          823  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
          824  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
          825  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
          826  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
          827  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
          828  +  JJ bb 73   JJ bb 73   JJ bb 73}
   235    829   
   236    830   do_execsql_test 1.7.4 {
   237    831     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   238         -} {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}
          832  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 934   AA bb 934
          833  +  AA bb 934   AA bb 934   BB aa 934   BB aa 934   BB aa 934   BB aa 934
          834  +  BB aa 934   BB aa 934   BB bb 934   BB bb 934   BB bb 934   BB bb 934
          835  +  BB bb 934   BB bb 934   CC aa 870   CC aa 870   CC aa 870   CC aa 870
          836  +  CC bb 840   CC bb 840   DD aa 840   DD aa 840   DD aa 840   DD bb 845
          837  +  DD bb 845   DD bb 845   DD bb 845   EE aa 959   EE aa 959   EE bb 959
          838  +  EE bb 959   EE bb 959   FF aa 959   FF aa 959   FF aa 959   FF aa 959
          839  +  FF bb 777   FF bb 777   FF bb 777   FF bb 777   FF bb 777   FF bb 777
          840  +  GG aa 938   GG aa 938   GG aa 938   GG aa 938   GG bb 938   GG bb 938
          841  +  GG bb 938   GG bb 938   HH aa 938   HH aa 938   HH aa 938   HH bb 979
          842  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
          843  +  II aa 979   II bb 979   II bb 979   II bb 979   II bb 979   II bb 979
          844  +  JJ aa 963   JJ aa 963   JJ aa 963   JJ aa 963   JJ bb 899   JJ bb 899
          845  +  JJ bb 899   JJ bb 899}
   239    846   
   240    847   do_execsql_test 1.7.5 {
   241    848     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   242         -} {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}
          849  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 223   AA bb 223
          850  +  AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223
          851  +  BB aa 223   BB aa 223   BB bb 223   BB bb 223   BB bb 223   BB bb 223
          852  +  BB bb 223   BB bb 223   CC aa 247   CC aa 247   CC aa 247   CC aa 247
          853  +  CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 158
          854  +  DD bb 158   DD bb 158   DD bb 158   EE aa 224   EE aa 224   EE bb 113
          855  +  EE bb 113   EE bb 113   FF aa 113   FF aa 113   FF aa 113   FF aa 113
          856  +  FF bb 113   FF bb 113   FF bb 113   FF bb 113   FF bb 113   FF bb 113
          857  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
          858  +  GG bb 102   GG bb 102   HH aa 102   HH aa 102   HH aa 102   HH bb 148
          859  +  HH bb 148   HH bb 148   HH bb 148   HH bb 148   HH bb 148   II aa 133
          860  +  II aa 133   II bb 133   II bb 133   II bb 133   II bb 133   II bb 133
          861  +  JJ aa 133   JJ aa 133   JJ aa 133   JJ aa 133   JJ bb 113   JJ bb 113
          862  +  JJ bb 113   JJ bb 113}
   243    863   
   244    864   do_execsql_test 1.7.6 {
   245    865     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;
   246         -} {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}
          866  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
          867  +  AA bb {}   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          868  +  BB aa 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685   BB bb 4685
          869  +  BB bb 4685   CC aa 12025   CC aa 12025   CC aa 12025   CC aa 12025
          870  +  CC bb 12025   CC bb 12025   DD aa 15147   DD aa 15147   DD aa 15147
          871  +  DD bb 15147   DD bb 15147   DD bb 15147   DD bb 15147   EE aa 14494
          872  +  EE aa 14494   EE bb 14494   EE bb 14494   EE bb 14494   FF aa 9693
          873  +  FF aa 9693   FF aa 9693   FF aa 9693   FF bb 9693   FF bb 9693   FF bb 9693
          874  +  FF bb 9693   FF bb 9693   FF bb 9693   GG aa 12239   GG aa 12239
          875  +  GG aa 12239   GG aa 12239   GG bb 12239   GG bb 12239   GG bb 12239
          876  +  GG bb 12239   HH aa 12675   HH aa 12675   HH aa 12675   HH bb 12675
          877  +  HH bb 12675   HH bb 12675   HH bb 12675   HH bb 12675   HH bb 12675
          878  +  II aa 15579   II aa 15579   II bb 15579   II bb 15579   II bb 15579
          879  +  II bb 15579   II bb 15579   JJ aa 13551   JJ aa 13551   JJ aa 13551
          880  +  JJ aa 13551   JJ bb 13551   JJ bb 13551   JJ bb 13551   JJ bb 13551}
   247    881   
   248    882   do_execsql_test 1.7.7 {
   249    883     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;
   250         -} {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}
          884  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb 2307   AA bb 2307
          885  +  AA bb 2307   AA bb 2307   BB aa 4685   BB aa 4685   BB aa 4685   BB aa 4685
          886  +  BB aa 4685   BB aa 4685   BB bb 7558   BB bb 7558   BB bb 7558   BB bb 7558
          887  +  BB bb 7558   BB bb 7558   CC aa 9718   CC aa 9718   CC aa 9718   CC aa 9718
          888  +  CC bb 9294   CC bb 9294   DD aa 7589   DD aa 7589   DD aa 7589   DD bb 4447
          889  +  DD bb 4447   DD bb 4447   DD bb 4447   EE aa 5200   EE aa 5200   EE bb 4922
          890  +  EE bb 4922   EE bb 4922   FF aa 5246   FF aa 5246   FF aa 5246   FF aa 5246
          891  +  FF bb 4702   FF bb 4702   FF bb 4702   FF bb 4702   FF bb 4702   FF bb 4702
          892  +  GG aa 7317   GG aa 7317   GG aa 7317   GG aa 7317   GG bb 7265   GG bb 7265
          893  +  GG bb 7265   GG bb 7265   HH aa 7973   HH aa 7973   HH aa 7973   HH bb 6717
          894  +  HH bb 6717   HH bb 6717   HH bb 6717   HH bb 6717   HH bb 6717   II aa 8314
          895  +  II aa 8314   II bb 6493   II bb 6493   II bb 6493   II bb 6493   II bb 6493
          896  +  JJ aa 6834   JJ aa 6834   JJ aa 6834   JJ aa 6834   JJ bb 5654   JJ bb 5654
          897  +  JJ bb 5654   JJ bb 5654}
   251    898   
   252    899   do_execsql_test 1.8.1 {
   253    900     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 3 PRECEDING         AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   254         -} {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}
          901  +} {AA aa 4685   AA aa 4685   AA aa 4685   AA aa 4685   AA bb 4685   AA bb 4685
          902  +  AA bb 4685   AA bb 4685   BB aa 12025   BB aa 12025   BB aa 12025
          903  +  BB aa 12025   BB aa 12025   BB aa 12025   BB bb 12025   BB bb 12025
          904  +  BB bb 12025   BB bb 12025   BB bb 12025   BB bb 12025   CC aa 15147
          905  +  CC aa 15147   CC aa 15147   CC aa 15147   CC bb 15147   CC bb 15147
          906  +  DD aa 19179   DD aa 19179   DD aa 19179   DD bb 19179   DD bb 19179
          907  +  DD bb 19179   DD bb 19179   EE aa 17033   EE aa 17033   EE bb 17033
          908  +  EE bb 17033   EE bb 17033   FF aa 15361   FF aa 15361   FF aa 15361
          909  +  FF aa 15361   FF bb 15361   FF bb 15361   FF bb 15361   FF bb 15361
          910  +  FF bb 15361   FF bb 15361   GG aa 16707   GG aa 16707   GG aa 16707
          911  +  GG aa 16707   GG bb 16707   GG bb 16707   GG bb 16707   GG bb 16707
          912  +  HH aa 18118   HH aa 18118   HH aa 18118   HH bb 18118   HH bb 18118
          913  +  HH bb 18118   HH bb 18118   HH bb 18118   HH bb 18118   II aa 19219
          914  +  II aa 19219   II bb 19219   II bb 19219   II bb 19219   II bb 19219
          915  +  II bb 19219   JJ aa 17351   JJ aa 17351   JJ aa 17351   JJ aa 17351
          916  +  JJ bb 17351   JJ bb 17351   JJ bb 17351   JJ bb 17351}
   255    917   
   256    918   do_execsql_test 1.8.2 {
   257    919     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   258         -} {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}
          920  +} {AA aa 2307   AA aa 2307   AA aa 2307   AA aa 2307   AA bb 4685   AA bb 4685
          921  +  AA bb 4685   AA bb 4685   BB aa 7558   BB aa 7558   BB aa 7558   BB aa 7558
          922  +  BB aa 7558   BB aa 7558   BB bb 12025   BB bb 12025   BB bb 12025
          923  +  BB bb 12025   BB bb 12025   BB bb 12025   CC aa 11672   CC aa 11672
          924  +  CC aa 11672   CC aa 11672   CC bb 10462   CC bb 10462   DD aa 8914
          925  +  DD aa 8914   DD aa 8914   DD bb 7154   DD bb 7154   DD bb 7154   DD bb 7154
          926  +  EE aa 6090   EE aa 6090   EE bb 6571   EE bb 6571   EE bb 6571   FF aa 7409
          927  +  FF aa 7409   FF aa 7409   FF aa 7409   FF bb 8207   FF bb 8207   FF bb 8207
          928  +  FF bb 8207   FF bb 8207   FF bb 8207   GG aa 8914   GG aa 8914   GG aa 8914
          929  +  GG aa 8914   GG bb 10136   GG bb 10136   GG bb 10136   GG bb 10136
          930  +  HH aa 10222   HH aa 10222   HH aa 10222   HH bb 9911   HH bb 9911
          931  +  HH bb 9911   HH bb 9911   HH bb 9911   HH bb 9911   II aa 9364   II aa 9364
          932  +  II bb 9083   II bb 9083   II bb 9083   II bb 9083   II bb 9083   JJ aa 8848
          933  +  JJ aa 8848   JJ aa 8848   JJ aa 8848   JJ bb 7440   JJ bb 7440   JJ bb 7440
          934  +  JJ bb 7440}
   259    935   
   260    936   do_execsql_test 1.8.3 {
   261    937     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 3 PRECEDING         AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   262         -} {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}
          938  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
          939  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
          940  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
          941  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
          942  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
          943  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
          944  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
          945  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
          946  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
          947  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
          948  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
          949  +  JJ bb 73   JJ bb 73   JJ bb 73}
   263    950   
   264    951   do_execsql_test 1.8.4 {
   265    952     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   266         -} {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}
          953  +} {AA aa 934   AA aa 934   AA aa 934   AA aa 934   AA bb 934   AA bb 934
          954  +  AA bb 934   AA bb 934   BB aa 934   BB aa 934   BB aa 934   BB aa 934
          955  +  BB aa 934   BB aa 934   BB bb 934   BB bb 934   BB bb 934   BB bb 934
          956  +  BB bb 934   BB bb 934   CC aa 870   CC aa 870   CC aa 870   CC aa 870
          957  +  CC bb 840   CC bb 840   DD aa 845   DD aa 845   DD aa 845   DD bb 959
          958  +  DD bb 959   DD bb 959   DD bb 959   EE aa 959   EE aa 959   EE bb 959
          959  +  EE bb 959   EE bb 959   FF aa 959   FF aa 959   FF aa 959   FF aa 959
          960  +  FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938
          961  +  GG aa 938   GG aa 938   GG aa 938   GG aa 938   GG bb 938   GG bb 938
          962  +  GG bb 938   GG bb 938   HH aa 979   HH aa 979   HH aa 979   HH bb 979
          963  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
          964  +  II aa 979   II bb 979   II bb 979   II bb 979   II bb 979   II bb 979
          965  +  JJ aa 963   JJ aa 963   JJ aa 963   JJ aa 963   JJ bb 899   JJ bb 899
          966  +  JJ bb 899   JJ bb 899}
   267    967   
   268    968   do_execsql_test 1.8.5 {
   269    969     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
   270         -} {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}
          970  +} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 223   AA bb 223
          971  +  AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223
          972  +  BB aa 223   BB aa 223   BB bb 223   BB bb 223   BB bb 223   BB bb 223
          973  +  BB bb 223   BB bb 223   CC aa 158   CC aa 158   CC aa 158   CC aa 158
          974  +  CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 158
          975  +  DD bb 158   DD bb 158   DD bb 158   EE aa 113   EE aa 113   EE bb 113
          976  +  EE bb 113   EE bb 113   FF aa 113   FF aa 113   FF aa 113   FF aa 113
          977  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
          978  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
          979  +  GG bb 102   GG bb 102   HH aa 102   HH aa 102   HH aa 102   HH bb 133
          980  +  HH bb 133   HH bb 133   HH bb 133   HH bb 133   HH bb 133   II aa 133
          981  +  II aa 133   II bb 133   II bb 133   II bb 133   II bb 133   II bb 133
          982  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 113   JJ bb 113
          983  +  JJ bb 113   JJ bb 113}
   271    984   
   272    985   do_execsql_test 1.8.6 {
   273    986     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;
   274         -} {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}
          987  +} {AA aa 3751   AA aa 3774   AA aa 4446   AA aa 4462   AA bb 3815   AA bb 4058
          988  +  AA bb 4113   AA bb 4376   BB aa 11263   BB aa 11365   BB aa 11613
          989  +  BB aa 11626   BB aa 11632   BB aa 11778   BB bb 11185   BB bb 11233
          990  +  BB bb 11239   BB bb 11314   BB bb 11320   BB bb 11392   CC aa 14388
          991  +  CC aa 14540   CC aa 14717   CC aa 14989   CC bb 14325   CC bb 14801
          992  +  DD aa 18334   DD aa 18923   DD aa 18955   DD bb 18220   DD bb 18385
          993  +  DD bb 18463   DD bb 18941   EE aa 16256   EE aa 16920   EE bb 16265
          994  +  EE bb 16404   EE bb 16781   FF aa 14691   FF aa 14694   FF aa 14743
          995  +  FF aa 15153   FF bb 14423   FF bb 14491   FF bb 14635   FF bb 14787
          996  +  FF bb 15066   FF bb 15259   GG aa 16073   GG aa 16227   GG aa 16372
          997  +  GG aa 16559   GG bb 15769   GG bb 15778   GG bb 15863   GG bb 16547
          998  +  HH aa 17139   HH aa 17328   HH aa 17638   HH bb 17155   HH bb 17388
          999  +  HH bb 17435   HH bb 17763   HH bb 17788   HH bb 17985   II aa 18567
         1000  +  II aa 18821   II bb 18414   II bb 18548   II bb 18776   II bb 18798
         1001  +  II bb 18969   JJ aa 16452   JJ aa 16583   JJ aa 17117   JJ aa 17238
         1002  +  JJ bb 16512   JJ bb 16997   JJ bb 17015   JJ bb 17094}
   275   1003   
   276   1004   do_execsql_test 1.8.7 {
   277   1005     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;
   278         -} {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}
         1006  +} {AA aa 1373   AA aa 1396   AA aa 2068   AA aa 2084   AA bb 3815   AA bb 4058
         1007  +  AA bb 4113   AA bb 4376   BB aa 6796   BB aa 6898   BB aa 7146   BB aa 7159
         1008  +  BB aa 7165   BB aa 7311   BB bb 11185   BB bb 11233   BB bb 11239
         1009  +  BB bb 11314   BB bb 11320   BB bb 11392   CC aa 10913   CC aa 11065
         1010  +  CC aa 11242   CC aa 11514   CC bb 9640   CC bb 10116   DD aa 8069
         1011  +  DD aa 8658   DD aa 8690   DD bb 6195   DD bb 6360   DD bb 6438   DD bb 6916
         1012  +  EE aa 5313   EE aa 5977   EE bb 5803   EE bb 5942   EE bb 6319   FF aa 6739
         1013  +  FF aa 6742   FF aa 6791   FF aa 7201   FF bb 7269   FF bb 7337   FF bb 7481
         1014  +  FF bb 7633   FF bb 7912   FF bb 8105   GG aa 8280   GG aa 8434   GG aa 8579
         1015  +  GG aa 8766   GG bb 9198   GG bb 9207   GG bb 9292   GG bb 9976   HH aa 9243
         1016  +  HH aa 9432   HH aa 9742   HH bb 8948   HH bb 9181   HH bb 9228   HH bb 9556
         1017  +  HH bb 9581   HH bb 9778   II aa 8712   II aa 8966   II bb 8278   II bb 8412
         1018  +  II bb 8640   II bb 8662   II bb 8833   JJ aa 7949   JJ aa 8080   JJ aa 8614
         1019  +  JJ aa 8735   JJ bb 6601   JJ bb 7086   JJ bb 7104   JJ bb 7183}
   279   1020   
   280   1021   do_execsql_test 1.9.1 {
   281   1022     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 2 PRECEDING         AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
   282         -} {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}
         1023  +} {AA aa 4685   AA aa 4685   AA aa 4685   AA aa 4685   AA bb 4685   AA bb 4685
         1024  +  AA bb 4685   AA bb 4685   BB aa 12025   BB aa 12025   BB aa 12025
         1025  +  BB aa 12025   BB aa 12025   BB aa 12025   BB bb 12025   BB bb 12025
         1026  +  BB bb 12025   BB bb 12025   BB bb 12025   BB bb 12025   CC aa 15147
         1027  +  CC aa 15147   CC aa 15147   CC aa 15147   CC bb 15147   CC bb 15147
         1028  +  DD aa 14494   DD aa 14494   DD aa 14494   DD bb 14494   DD bb 14494
         1029  +  DD bb 14494   DD bb 14494   EE aa 9693   EE aa 9693   EE bb 9693
         1030  +  EE bb 9693   EE bb 9693   FF aa 12239   FF aa 12239   FF aa 12239
         1031  +  FF aa 12239   FF bb 12239   FF bb 12239   FF bb 12239   FF bb 12239
         1032  +  FF bb 12239   FF bb 12239   GG aa 12675   GG aa 12675   GG aa 12675
         1033  +  GG aa 12675   GG bb 12675   GG bb 12675   GG bb 12675   GG bb 12675
         1034  +  HH aa 15579   HH aa 15579   HH aa 15579   HH bb 15579   HH bb 15579
         1035  +  HH bb 15579   HH bb 15579   HH bb 15579   HH bb 15579   II aa 13551
         1036  +  II aa 13551   II bb 13551   II bb 13551   II bb 13551   II bb 13551
         1037  +  II bb 13551   JJ aa 12883   JJ aa 12883   JJ aa 12883   JJ aa 12883
         1038  +  JJ bb 12883   JJ bb 12883   JJ bb 12883   JJ bb 12883}
   283   1039   
   284   1040   do_execsql_test 1.9.2 {
   285   1041     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
   286         -} {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}
         1042  +} {AA aa 2307   AA aa 2307   AA aa 2307   AA aa 2307   AA bb 4685   AA bb 4685
         1043  +  AA bb 4685   AA bb 4685   BB aa 7558   BB aa 7558   BB aa 7558   BB aa 7558
         1044  +  BB aa 7558   BB aa 7558   BB bb 9718   BB bb 9718   BB bb 9718   BB bb 9718
         1045  +  BB bb 9718   BB bb 9718   CC aa 9294   CC aa 9294   CC aa 9294   CC aa 9294
         1046  +  CC bb 7589   CC bb 7589   DD aa 4447   DD aa 4447   DD aa 4447   DD bb 5200
         1047  +  DD bb 5200   DD bb 5200   DD bb 5200   EE aa 4922   EE aa 4922   EE bb 5246
         1048  +  EE bb 5246   EE bb 5246   FF aa 4702   FF aa 4702   FF aa 4702   FF aa 4702
         1049  +  FF bb 7317   FF bb 7317   FF bb 7317   FF bb 7317   FF bb 7317   FF bb 7317
         1050  +  GG aa 7265   GG aa 7265   GG aa 7265   GG aa 7265   GG bb 7973   GG bb 7973
         1051  +  GG bb 7973   GG bb 7973   HH aa 6717   HH aa 6717   HH aa 6717   HH bb 8314
         1052  +  HH bb 8314   HH bb 8314   HH bb 8314   HH bb 8314   HH bb 8314   II aa 6493
         1053  +  II aa 6493   II bb 6834   II bb 6834   II bb 6834   II bb 6834   II bb 6834
         1054  +  JJ aa 5654   JJ aa 5654   JJ aa 5654   JJ aa 5654   JJ bb 6390   JJ bb 6390
         1055  +  JJ bb 6390   JJ bb 6390}
   287   1056   
   288   1057   do_execsql_test 1.9.3 {
   289   1058     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 2 PRECEDING         AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
   290         -} {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}
         1059  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         1060  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         1061  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         1062  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         1063  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         1064  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         1065  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         1066  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         1067  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         1068  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         1069  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         1070  +  JJ bb 73   JJ bb 73   JJ bb 73}
   291   1071   
   292   1072   do_execsql_test 1.9.4 {
   293   1073     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
   294         -} {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}
         1074  +} {AA aa 934   AA aa 934   AA aa 934   AA aa 934   AA bb 934   AA bb 934
         1075  +  AA bb 934   AA bb 934   BB aa 934   BB aa 934   BB aa 934   BB aa 934
         1076  +  BB aa 934   BB aa 934   BB bb 870   BB bb 870   BB bb 870   BB bb 870
         1077  +  BB bb 870   BB bb 870   CC aa 840   CC aa 840   CC aa 840   CC aa 840
         1078  +  CC bb 840   CC bb 840   DD aa 845   DD aa 845   DD aa 845   DD bb 959
         1079  +  DD bb 959   DD bb 959   DD bb 959   EE aa 959   EE aa 959   EE bb 959
         1080  +  EE bb 959   EE bb 959   FF aa 777   FF aa 777   FF aa 777   FF aa 777
         1081  +  FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938
         1082  +  GG aa 938   GG aa 938   GG aa 938   GG aa 938   GG bb 938   GG bb 938
         1083  +  GG bb 938   GG bb 938   HH aa 979   HH aa 979   HH aa 979   HH bb 979
         1084  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
         1085  +  II aa 979   II bb 963   II bb 963   II bb 963   II bb 963   II bb 963
         1086  +  JJ aa 899   JJ aa 899   JJ aa 899   JJ aa 899   JJ bb 899   JJ bb 899
         1087  +  JJ bb 899   JJ bb 899}
   295   1088   
   296   1089   do_execsql_test 1.9.5 {
   297   1090     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
   298         -} {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}
         1091  +} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 223   AA bb 223
         1092  +  AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223
         1093  +  BB aa 223   BB aa 223   BB bb 247   BB bb 247   BB bb 247   BB bb 247
         1094  +  BB bb 247   BB bb 247   CC aa 158   CC aa 158   CC aa 158   CC aa 158
         1095  +  CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 224
         1096  +  DD bb 224   DD bb 224   DD bb 224   EE aa 113   EE aa 113   EE bb 113
         1097  +  EE bb 113   EE bb 113   FF aa 113   FF aa 113   FF aa 113   FF aa 113
         1098  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
         1099  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
         1100  +  GG bb 102   GG bb 102   HH aa 148   HH aa 148   HH aa 148   HH bb 133
         1101  +  HH bb 133   HH bb 133   HH bb 133   HH bb 133   HH bb 133   II aa 133
         1102  +  II aa 133   II bb 133   II bb 133   II bb 133   II bb 133   II bb 133
         1103  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 113   JJ bb 113
         1104  +  JJ bb 113   JJ bb 113}
   299   1105   
   300   1106   do_execsql_test 1.9.6 {
   301   1107     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;
   302         -} {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}
         1108  +} {AA aa 3751   AA aa 3774   AA aa 4446   AA aa 4462   AA bb 3815   AA bb 4058
         1109  +  AA bb 4113   AA bb 4376   BB aa 11263   BB aa 11365   BB aa 11613
         1110  +  BB aa 11626   BB aa 11632   BB aa 11778   BB bb 11185   BB bb 11233
         1111  +  BB bb 11239   BB bb 11314   BB bb 11320   BB bb 11392   CC aa 14388
         1112  +  CC aa 14540   CC aa 14717   CC aa 14989   CC bb 14325   CC bb 14801
         1113  +  DD aa 13649   DD aa 14238   DD aa 14270   DD bb 13535   DD bb 13700
         1114  +  DD bb 13778   DD bb 14256   EE aa 8916   EE aa 9580   EE bb 8925
         1115  +  EE bb 9064   EE bb 9441   FF aa 11569   FF aa 11572   FF aa 11621
         1116  +  FF aa 12031   FF bb 11301   FF bb 11369   FF bb 11513   FF bb 11665
         1117  +  FF bb 11944   FF bb 12137   GG aa 12041   GG aa 12195   GG aa 12340
         1118  +  GG aa 12527   GG bb 11737   GG bb 11746   GG bb 11831   GG bb 12515
         1119  +  HH aa 14600   HH aa 14789   HH aa 15099   HH bb 14616   HH bb 14849
         1120  +  HH bb 14896   HH bb 15224   HH bb 15249   HH bb 15446   II aa 12899
         1121  +  II aa 13153   II bb 12746   II bb 12880   II bb 13108   II bb 13130
         1122  +  II bb 13301   JJ aa 11984   JJ aa 12115   JJ aa 12649   JJ aa 12770
         1123  +  JJ bb 12044   JJ bb 12529   JJ bb 12547   JJ bb 12626}
   303   1124   
   304   1125   do_execsql_test 1.9.7 {
   305   1126     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;
   306         -} {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}
         1127  +} {AA aa 1373   AA aa 1396   AA aa 2068   AA aa 2084   AA bb 3815   AA bb 4058
         1128  +  AA bb 4113   AA bb 4376   BB aa 6796   BB aa 6898   BB aa 7146   BB aa 7159
         1129  +  BB aa 7165   BB aa 7311   BB bb 8878   BB bb 8926   BB bb 8932   BB bb 9007
         1130  +  BB bb 9013   BB bb 9085   CC aa 8535   CC aa 8687   CC aa 8864   CC aa 9136
         1131  +  CC bb 6767   CC bb 7243   DD aa 3602   DD aa 4191   DD aa 4223   DD bb 4241
         1132  +  DD bb 4406   DD bb 4484   DD bb 4962   EE aa 4145   EE aa 4809   EE bb 4478
         1133  +  EE bb 4617   EE bb 4994   FF aa 4032   FF aa 4035   FF aa 4084   FF aa 4494
         1134  +  FF bb 6379   FF bb 6447   FF bb 6591   FF bb 6743   FF bb 7022   FF bb 7215
         1135  +  GG aa 6631   GG aa 6785   GG aa 6930   GG aa 7117   GG bb 7035   GG bb 7044
         1136  +  GG bb 7129   GG bb 7813   HH aa 5738   HH aa 5927   HH aa 6237   HH bb 7351
         1137  +  HH bb 7584   HH bb 7631   HH bb 7959   HH bb 7984   HH bb 8181   II aa 5841
         1138  +  II aa 6095   II bb 6029   II bb 6163   II bb 6391   II bb 6413   II bb 6584
         1139  +  JJ aa 4755   JJ aa 4886   JJ aa 5420   JJ aa 5541   JJ bb 5551   JJ bb 6036
         1140  +  JJ bb 6054   JJ bb 6133}
   307   1141   
   308   1142   do_execsql_test 1.10.1 {
   309   1143     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 3 PRECEDING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   310         -} {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}
         1144  +} {AA aa 4685   AA aa 4685   AA aa 4685   AA aa 4685   AA bb 4685   AA bb 4685
         1145  +  AA bb 4685   AA bb 4685   BB aa 12025   BB aa 12025   BB aa 12025
         1146  +  BB aa 12025   BB aa 12025   BB aa 12025   BB bb 12025   BB bb 12025
         1147  +  BB bb 12025   BB bb 12025   BB bb 12025   BB bb 12025   CC aa 15147
         1148  +  CC aa 15147   CC aa 15147   CC aa 15147   CC bb 15147   CC bb 15147
         1149  +  DD aa 19179   DD aa 19179   DD aa 19179   DD bb 19179   DD bb 19179
         1150  +  DD bb 19179   DD bb 19179   EE aa 17033   EE aa 17033   EE bb 17033
         1151  +  EE bb 17033   EE bb 17033   FF aa 15361   FF aa 15361   FF aa 15361
         1152  +  FF aa 15361   FF bb 15361   FF bb 15361   FF bb 15361   FF bb 15361
         1153  +  FF bb 15361   FF bb 15361   GG aa 16707   GG aa 16707   GG aa 16707
         1154  +  GG aa 16707   GG bb 16707   GG bb 16707   GG bb 16707   GG bb 16707
         1155  +  HH aa 18118   HH aa 18118   HH aa 18118   HH bb 18118   HH bb 18118
         1156  +  HH bb 18118   HH bb 18118   HH bb 18118   HH bb 18118   II aa 19219
         1157  +  II aa 19219   II bb 19219   II bb 19219   II bb 19219   II bb 19219
         1158  +  II bb 19219   JJ aa 17351   JJ aa 17351   JJ aa 17351   JJ aa 17351
         1159  +  JJ bb 17351   JJ bb 17351   JJ bb 17351   JJ bb 17351}
   311   1160   
   312   1161   do_execsql_test 1.10.2 {
   313   1162     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   314         -} {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}
         1163  +} {AA aa 2307   AA aa 2307   AA aa 2307   AA aa 2307   AA bb 4685   AA bb 4685
         1164  +  AA bb 4685   AA bb 4685   BB aa 7558   BB aa 7558   BB aa 7558   BB aa 7558
         1165  +  BB aa 7558   BB aa 7558   BB bb 12025   BB bb 12025   BB bb 12025
         1166  +  BB bb 12025   BB bb 12025   BB bb 12025   CC aa 11672   CC aa 11672
         1167  +  CC aa 11672   CC aa 11672   CC bb 10462   CC bb 10462   DD aa 8914
         1168  +  DD aa 8914   DD aa 8914   DD bb 7154   DD bb 7154   DD bb 7154   DD bb 7154
         1169  +  EE aa 6090   EE aa 6090   EE bb 6571   EE bb 6571   EE bb 6571   FF aa 7409
         1170  +  FF aa 7409   FF aa 7409   FF aa 7409   FF bb 8207   FF bb 8207   FF bb 8207
         1171  +  FF bb 8207   FF bb 8207   FF bb 8207   GG aa 8914   GG aa 8914   GG aa 8914
         1172  +  GG aa 8914   GG bb 10136   GG bb 10136   GG bb 10136   GG bb 10136
         1173  +  HH aa 10222   HH aa 10222   HH aa 10222   HH bb 9911   HH bb 9911
         1174  +  HH bb 9911   HH bb 9911   HH bb 9911   HH bb 9911   II aa 9364   II aa 9364
         1175  +  II bb 9083   II bb 9083   II bb 9083   II bb 9083   II bb 9083   JJ aa 8848
         1176  +  JJ aa 8848   JJ aa 8848   JJ aa 8848   JJ bb 7440   JJ bb 7440   JJ bb 7440
         1177  +  JJ bb 7440}
   315   1178   
   316   1179   do_execsql_test 1.10.3 {
   317   1180     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 3 PRECEDING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   318         -} {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}
         1181  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         1182  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         1183  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         1184  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         1185  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         1186  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         1187  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         1188  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         1189  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         1190  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         1191  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         1192  +  JJ bb 73   JJ bb 73   JJ bb 73}
   319   1193   
   320   1194   do_execsql_test 1.10.4 {
   321   1195     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   322         -} {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}
         1196  +} {AA aa 934   AA aa 934   AA aa 934   AA aa 934   AA bb 934   AA bb 934
         1197  +  AA bb 934   AA bb 934   BB aa 934   BB aa 934   BB aa 934   BB aa 934
         1198  +  BB aa 934   BB aa 934   BB bb 934   BB bb 934   BB bb 934   BB bb 934
         1199  +  BB bb 934   BB bb 934   CC aa 870   CC aa 870   CC aa 870   CC aa 870
         1200  +  CC bb 840   CC bb 840   DD aa 845   DD aa 845   DD aa 845   DD bb 959
         1201  +  DD bb 959   DD bb 959   DD bb 959   EE aa 959   EE aa 959   EE bb 959
         1202  +  EE bb 959   EE bb 959   FF aa 959   FF aa 959   FF aa 959   FF aa 959
         1203  +  FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938
         1204  +  GG aa 938   GG aa 938   GG aa 938   GG aa 938   GG bb 938   GG bb 938
         1205  +  GG bb 938   GG bb 938   HH aa 979   HH aa 979   HH aa 979   HH bb 979
         1206  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
         1207  +  II aa 979   II bb 979   II bb 979   II bb 979   II bb 979   II bb 979
         1208  +  JJ aa 963   JJ aa 963   JJ aa 963   JJ aa 963   JJ bb 899   JJ bb 899
         1209  +  JJ bb 899   JJ bb 899}
   323   1210   
   324   1211   do_execsql_test 1.10.5 {
   325   1212     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 3 PRECEDING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   326         -} {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}
         1213  +} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 223   AA bb 223
         1214  +  AA bb 223   AA bb 223   BB aa 223   BB aa 223   BB aa 223   BB aa 223
         1215  +  BB aa 223   BB aa 223   BB bb 223   BB bb 223   BB bb 223   BB bb 223
         1216  +  BB bb 223   BB bb 223   CC aa 158   CC aa 158   CC aa 158   CC aa 158
         1217  +  CC bb 158   CC bb 158   DD aa 158   DD aa 158   DD aa 158   DD bb 158
         1218  +  DD bb 158   DD bb 158   DD bb 158   EE aa 113   EE aa 113   EE bb 113
         1219  +  EE bb 113   EE bb 113   FF aa 113   FF aa 113   FF aa 113   FF aa 113
         1220  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
         1221  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
         1222  +  GG bb 102   GG bb 102   HH aa 102   HH aa 102   HH aa 102   HH bb 133
         1223  +  HH bb 133   HH bb 133   HH bb 133   HH bb 133   HH bb 133   II aa 133
         1224  +  II aa 133   II bb 133   II bb 133   II bb 133   II bb 133   II bb 133
         1225  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 113   JJ bb 113
         1226  +  JJ bb 113   JJ bb 113}
   327   1227   
   328   1228   do_execsql_test 1.10.6 {
   329   1229     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;
   330         -} {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}
         1230  +} {AA aa 3751   AA aa 3774   AA aa 4446   AA aa 4462   AA bb 3815   AA bb 4058
         1231  +  AA bb 4113   AA bb 4376   BB aa 11263   BB aa 11365   BB aa 11613
         1232  +  BB aa 11626   BB aa 11632   BB aa 11778   BB bb 11185   BB bb 11233
         1233  +  BB bb 11239   BB bb 11314   BB bb 11320   BB bb 11392   CC aa 14388
         1234  +  CC aa 14540   CC aa 14717   CC aa 14989   CC bb 14325   CC bb 14801
         1235  +  DD aa 18334   DD aa 18923   DD aa 18955   DD bb 18220   DD bb 18385
         1236  +  DD bb 18463   DD bb 18941   EE aa 16256   EE aa 16920   EE bb 16265
         1237  +  EE bb 16404   EE bb 16781   FF aa 14691   FF aa 14694   FF aa 14743
         1238  +  FF aa 15153   FF bb 14423   FF bb 14491   FF bb 14635   FF bb 14787
         1239  +  FF bb 15066   FF bb 15259   GG aa 16073   GG aa 16227   GG aa 16372
         1240  +  GG aa 16559   GG bb 15769   GG bb 15778   GG bb 15863   GG bb 16547
         1241  +  HH aa 17139   HH aa 17328   HH aa 17638   HH bb 17155   HH bb 17388
         1242  +  HH bb 17435   HH bb 17763   HH bb 17788   HH bb 17985   II aa 18567
         1243  +  II aa 18821   II bb 18414   II bb 18548   II bb 18776   II bb 18798
         1244  +  II bb 18969   JJ aa 16452   JJ aa 16583   JJ aa 17117   JJ aa 17238
         1245  +  JJ bb 16512   JJ bb 16997   JJ bb 17015   JJ bb 17094}
   331   1246   
   332   1247   do_execsql_test 1.10.7 {
   333   1248     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;
   334         -} {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}
         1249  +} {AA aa 1373   AA aa 1396   AA aa 2068   AA aa 2084   AA bb 3815   AA bb 4058
         1250  +  AA bb 4113   AA bb 4376   BB aa 6796   BB aa 6898   BB aa 7146   BB aa 7159
         1251  +  BB aa 7165   BB aa 7311   BB bb 11185   BB bb 11233   BB bb 11239
         1252  +  BB bb 11314   BB bb 11320   BB bb 11392   CC aa 10913   CC aa 11065
         1253  +  CC aa 11242   CC aa 11514   CC bb 9640   CC bb 10116   DD aa 8069
         1254  +  DD aa 8658   DD aa 8690   DD bb 6195   DD bb 6360   DD bb 6438   DD bb 6916
         1255  +  EE aa 5313   EE aa 5977   EE bb 5803   EE bb 5942   EE bb 6319   FF aa 6739
         1256  +  FF aa 6742   FF aa 6791   FF aa 7201   FF bb 7269   FF bb 7337   FF bb 7481
         1257  +  FF bb 7633   FF bb 7912   FF bb 8105   GG aa 8280   GG aa 8434   GG aa 8579
         1258  +  GG aa 8766   GG bb 9198   GG bb 9207   GG bb 9292   GG bb 9976   HH aa 9243
         1259  +  HH aa 9432   HH aa 9742   HH bb 8948   HH bb 9181   HH bb 9228   HH bb 9556
         1260  +  HH bb 9581   HH bb 9778   II aa 8712   II aa 8966   II bb 8278   II bb 8412
         1261  +  II bb 8640   II bb 8662   II bb 8833   JJ aa 7949   JJ aa 8080   JJ aa 8614
         1262  +  JJ aa 8735   JJ bb 6601   JJ bb 7086   JJ bb 7104   JJ bb 7183}
   335   1263   
   336   1264   do_execsql_test 1.11.1 {
   337   1265     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 2 PRECEDING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   338         -} {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}
         1266  +} {AA aa 44737   AA aa 44737   AA aa 44737   AA aa 44737   AA bb 44737
         1267  +  AA bb 44737   AA bb 44737   AA bb 44737   BB aa 44737   BB aa 44737
         1268  +  BB aa 44737   BB aa 44737   BB aa 44737   BB aa 44737   BB bb 44737
         1269  +  BB bb 44737   BB bb 44737   BB bb 44737   BB bb 44737   BB bb 44737
         1270  +  CC aa 44737   CC aa 44737   CC aa 44737   CC aa 44737   CC bb 44737
         1271  +  CC bb 44737   DD aa 40052   DD aa 40052   DD aa 40052   DD bb 40052
         1272  +  DD bb 40052   DD bb 40052   DD bb 40052   EE aa 32712   EE aa 32712
         1273  +  EE bb 32712   EE bb 32712   EE bb 32712   FF aa 29590   FF aa 29590
         1274  +  FF aa 29590   FF aa 29590   FF bb 29590   FF bb 29590   FF bb 29590
         1275  +  FF bb 29590   FF bb 29590   FF bb 29590   GG aa 25558   GG aa 25558
         1276  +  GG aa 25558   GG aa 25558   GG bb 25558   GG bb 25558   GG bb 25558
         1277  +  GG bb 25558   HH aa 23019   HH aa 23019   HH aa 23019   HH bb 23019
         1278  +  HH bb 23019   HH bb 23019   HH bb 23019   HH bb 23019   HH bb 23019
         1279  +  II aa 17351   II aa 17351   II bb 17351   II bb 17351   II bb 17351
         1280  +  II bb 17351   II bb 17351   JJ aa 12883   JJ aa 12883   JJ aa 12883
         1281  +  JJ aa 12883   JJ bb 12883   JJ bb 12883   JJ bb 12883   JJ bb 12883}
   339   1282   
   340   1283   do_execsql_test 1.11.2 {
   341   1284     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   342         -} {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}
         1285  +} {AA aa 44737   AA aa 44737   AA aa 44737   AA aa 44737   AA bb 44737
         1286  +  AA bb 44737   AA bb 44737   AA bb 44737   BB aa 44737   BB aa 44737
         1287  +  BB aa 44737   BB aa 44737   BB aa 44737   BB aa 44737   BB bb 42430
         1288  +  BB bb 42430   BB bb 42430   BB bb 42430   BB bb 42430   BB bb 42430
         1289  +  CC aa 40052   CC aa 40052   CC aa 40052   CC aa 40052   CC bb 37179
         1290  +  CC bb 37179   DD aa 32712   DD aa 32712   DD aa 32712   DD bb 30758
         1291  +  DD bb 30758   DD bb 30758   DD bb 30758   EE aa 29590   EE aa 29590
         1292  +  EE bb 28265   EE bb 28265   EE bb 28265   FF aa 25558   FF aa 25558
         1293  +  FF aa 25558   FF aa 25558   FF bb 24668   FF bb 24668   FF bb 24668
         1294  +  FF bb 24668   FF bb 24668   FF bb 24668   GG aa 23019   GG aa 23019
         1295  +  GG aa 23019   GG aa 23019   GG bb 20856   GG bb 20856   GG bb 20856
         1296  +  GG bb 20856   HH aa 17351   HH aa 17351   HH aa 17351   HH bb 15754
         1297  +  HH bb 15754   HH bb 15754   HH bb 15754   HH bb 15754   HH bb 15754
         1298  +  II aa 12883   II aa 12883   II bb 10634   II bb 10634   II bb 10634
         1299  +  II bb 10634   II bb 10634   JJ aa 7440   JJ aa 7440   JJ aa 7440
         1300  +  JJ aa 7440   JJ bb 6390   JJ bb 6390   JJ bb 6390   JJ bb 6390}
   343   1301   
   344   1302   do_execsql_test 1.11.3 {
   345   1303     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 2 PRECEDING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   346         -} {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}
         1304  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         1305  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         1306  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         1307  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         1308  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         1309  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         1310  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         1311  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         1312  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         1313  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         1314  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         1315  +  JJ bb 73   JJ bb 73   JJ bb 73}
   347   1316   
   348   1317   do_execsql_test 1.11.4 {
   349   1318     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   350         -} {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}
         1319  +} {AA aa 979   AA aa 979   AA aa 979   AA aa 979   AA bb 979   AA bb 979
         1320  +  AA bb 979   AA bb 979   BB aa 979   BB aa 979   BB aa 979   BB aa 979
         1321  +  BB aa 979   BB aa 979   BB bb 979   BB bb 979   BB bb 979   BB bb 979
         1322  +  BB bb 979   BB bb 979   CC aa 979   CC aa 979   CC aa 979   CC aa 979
         1323  +  CC bb 979   CC bb 979   DD aa 979   DD aa 979   DD aa 979   DD bb 979
         1324  +  DD bb 979   DD bb 979   DD bb 979   EE aa 979   EE aa 979   EE bb 979
         1325  +  EE bb 979   EE bb 979   FF aa 979   FF aa 979   FF aa 979   FF aa 979
         1326  +  FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979
         1327  +  GG aa 979   GG aa 979   GG aa 979   GG aa 979   GG bb 979   GG bb 979
         1328  +  GG bb 979   GG bb 979   HH aa 979   HH aa 979   HH aa 979   HH bb 979
         1329  +  HH bb 979   HH bb 979   HH bb 979   HH bb 979   HH bb 979   II aa 979
         1330  +  II aa 979   II bb 963   II bb 963   II bb 963   II bb 963   II bb 963
         1331  +  JJ aa 899   JJ aa 899   JJ aa 899   JJ aa 899   JJ bb 899   JJ bb 899
         1332  +  JJ bb 899   JJ bb 899}
   351   1333   
   352   1334   do_execsql_test 1.11.5 {
   353   1335     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 2 PRECEDING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   354         -} {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}
         1336  +} {AA aa 102   AA aa 102   AA aa 102   AA aa 102   AA bb 102   AA bb 102
         1337  +  AA bb 102   AA bb 102   BB aa 102   BB aa 102   BB aa 102   BB aa 102
         1338  +  BB aa 102   BB aa 102   BB bb 102   BB bb 102   BB bb 102   BB bb 102
         1339  +  BB bb 102   BB bb 102   CC aa 102   CC aa 102   CC aa 102   CC aa 102
         1340  +  CC bb 102   CC bb 102   DD aa 102   DD aa 102   DD aa 102   DD bb 102
         1341  +  DD bb 102   DD bb 102   DD bb 102   EE aa 102   EE aa 102   EE bb 102
         1342  +  EE bb 102   EE bb 102   FF aa 102   FF aa 102   FF aa 102   FF aa 102
         1343  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
         1344  +  GG aa 102   GG aa 102   GG aa 102   GG aa 102   GG bb 102   GG bb 102
         1345  +  GG bb 102   GG bb 102   HH aa 113   HH aa 113   HH aa 113   HH bb 113
         1346  +  HH bb 113   HH bb 113   HH bb 113   HH bb 113   HH bb 113   II aa 113
         1347  +  II aa 113   II bb 113   II bb 113   II bb 113   II bb 113   II bb 113
         1348  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 113   JJ bb 113
         1349  +  JJ bb 113   JJ bb 113}
   355   1350   
   356   1351   do_execsql_test 1.11.6 {
   357   1352     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;
   358         -} {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}
         1353  +} {AA aa 43803   AA aa 43826   AA aa 44498   AA aa 44514   AA bb 43867
         1354  +  AA bb 44110   AA bb 44165   AA bb 44428   BB aa 43975   BB aa 44077
         1355  +  BB aa 44325   BB aa 44338   BB aa 44344   BB aa 44490   BB bb 43897
         1356  +  BB bb 43945   BB bb 43951   BB bb 44026   BB bb 44032   BB bb 44104
         1357  +  CC aa 43978   CC aa 44130   CC aa 44307   CC aa 44579   CC bb 43915
         1358  +  CC bb 44391   DD aa 39207   DD aa 39796   DD aa 39828   DD bb 39093
         1359  +  DD bb 39258   DD bb 39336   DD bb 39814   EE aa 31935   EE aa 32599
         1360  +  EE bb 31944   EE bb 32083   EE bb 32460   FF aa 28920   FF aa 28923
         1361  +  FF aa 28972   FF aa 29382   FF bb 28652   FF bb 28720   FF bb 28864
         1362  +  FF bb 29016   FF bb 29295   FF bb 29488   GG aa 24924   GG aa 25078
         1363  +  GG aa 25223   GG aa 25410   GG bb 24620   GG bb 24629   GG bb 24714
         1364  +  GG bb 25398   HH aa 22040   HH aa 22229   HH aa 22539   HH bb 22056
         1365  +  HH bb 22289   HH bb 22336   HH bb 22664   HH bb 22689   HH bb 22886
         1366  +  II aa 16699   II aa 16953   II bb 16546   II bb 16680   II bb 16908
         1367  +  II bb 16930   II bb 17101   JJ aa 11984   JJ aa 12115   JJ aa 12649
         1368  +  JJ aa 12770   JJ bb 12044   JJ bb 12529   JJ bb 12547   JJ bb 12626}
   359   1369   
   360   1370   do_execsql_test 1.11.7 {
   361   1371     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;
   362         -} {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}
         1372  +} {AA aa 43803   AA aa 43826   AA aa 44498   AA aa 44514   AA bb 43867
         1373  +  AA bb 44110   AA bb 44165   AA bb 44428   BB aa 43975   BB aa 44077
         1374  +  BB aa 44325   BB aa 44338   BB aa 44344   BB aa 44490   BB bb 41590
         1375  +  BB bb 41638   BB bb 41644   BB bb 41719   BB bb 41725   BB bb 41797
         1376  +  CC aa 39293   CC aa 39445   CC aa 39622   CC aa 39894   CC bb 36357
         1377  +  CC bb 36833   DD aa 31867   DD aa 32456   DD aa 32488   DD bb 29799
         1378  +  DD bb 29964   DD bb 30042   DD bb 30520   EE aa 28813   EE aa 29477
         1379  +  EE bb 27497   EE bb 27636   EE bb 28013   FF aa 24888   FF aa 24891
         1380  +  FF aa 24940   FF aa 25350   FF bb 23730   FF bb 23798   FF bb 23942
         1381  +  FF bb 24094   FF bb 24373   FF bb 24566   GG aa 22385   GG aa 22539
         1382  +  GG aa 22684   GG aa 22871   GG bb 19918   GG bb 19927   GG bb 20012
         1383  +  GG bb 20696   HH aa 16372   HH aa 16561   HH aa 16871   HH bb 14791
         1384  +  HH bb 15024   HH bb 15071   HH bb 15399   HH bb 15424   HH bb 15621
         1385  +  II aa 12231   II aa 12485   II bb 9829   II bb 9963   II bb 10191
         1386  +  II bb 10213   II bb 10384   JJ aa 6541   JJ aa 6672   JJ aa 7206
         1387  +  JJ aa 7327   JJ bb 5551   JJ bb 6036   JJ bb 6054   JJ bb 6133}
   363   1388   
   364   1389   do_execsql_test 1.12.1 {
   365   1390     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN CURRENT ROW         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   366         -} {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}
         1391  +} {AA aa 4685   AA aa 4685   AA aa 4685   AA aa 4685   AA bb 4685   AA bb 4685
         1392  +  AA bb 4685   AA bb 4685   BB aa 7340   BB aa 7340   BB aa 7340   BB aa 7340
         1393  +  BB aa 7340   BB aa 7340   BB bb 7340   BB bb 7340   BB bb 7340   BB bb 7340
         1394  +  BB bb 7340   BB bb 7340   CC aa 3122   CC aa 3122   CC aa 3122   CC aa 3122
         1395  +  CC bb 3122   CC bb 3122   DD aa 4032   DD aa 4032   DD aa 4032   DD bb 4032
         1396  +  DD bb 4032   DD bb 4032   DD bb 4032   EE aa 2539   EE aa 2539   EE bb 2539
         1397  +  EE bb 2539   EE bb 2539   FF aa 5668   FF aa 5668   FF aa 5668   FF aa 5668
         1398  +  FF bb 5668   FF bb 5668   FF bb 5668   FF bb 5668   FF bb 5668   FF bb 5668
         1399  +  GG aa 4468   GG aa 4468   GG aa 4468   GG aa 4468   GG bb 4468   GG bb 4468
         1400  +  GG bb 4468   GG bb 4468   HH aa 5443   HH aa 5443   HH aa 5443   HH bb 5443
         1401  +  HH bb 5443   HH bb 5443   HH bb 5443   HH bb 5443   HH bb 5443   II aa 3640
         1402  +  II aa 3640   II bb 3640   II bb 3640   II bb 3640   II bb 3640   II bb 3640
         1403  +  JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ bb 3800   JJ bb 3800
         1404  +  JJ bb 3800   JJ bb 3800}
   367   1405   
   368   1406   do_execsql_test 1.12.2 {
   369   1407     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   370         -} {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}
         1408  +} {AA aa 2307   AA aa 2307   AA aa 2307   AA aa 2307   AA bb 2378   AA bb 2378
         1409  +  AA bb 2378   AA bb 2378   BB aa 2873   BB aa 2873   BB aa 2873   BB aa 2873
         1410  +  BB aa 2873   BB aa 2873   BB bb 4467   BB bb 4467   BB bb 4467   BB bb 4467
         1411  +  BB bb 4467   BB bb 4467   CC aa 1954   CC aa 1954   CC aa 1954   CC aa 1954
         1412  +  CC bb 1168   CC bb 1168   DD aa 1325   DD aa 1325   DD aa 1325   DD bb 2707
         1413  +  DD bb 2707   DD bb 2707   DD bb 2707   EE aa 890   EE aa 890   EE bb 1649
         1414  +  EE bb 1649   EE bb 1649   FF aa 2163   FF aa 2163   FF aa 2163   FF aa 2163
         1415  +  FF bb 3505   FF bb 3505   FF bb 3505   FF bb 3505   FF bb 3505   FF bb 3505
         1416  +  GG aa 1597   GG aa 1597   GG aa 1597   GG aa 1597   GG bb 2871   GG bb 2871
         1417  +  GG bb 2871   GG bb 2871   HH aa 2249   HH aa 2249   HH aa 2249   HH bb 3194
         1418  +  HH bb 3194   HH bb 3194   HH bb 3194   HH bb 3194   HH bb 3194   II aa 1050
         1419  +  II aa 1050   II bb 2590   II bb 2590   II bb 2590   II bb 2590   II bb 2590
         1420  +  JJ aa 2014   JJ aa 2014   JJ aa 2014   JJ aa 2014   JJ bb 1786   JJ bb 1786
         1421  +  JJ bb 1786   JJ bb 1786}
   371   1422   
   372   1423   do_execsql_test 1.12.3 {
   373   1424     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN CURRENT ROW         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   374         -} {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}
         1425  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         1426  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         1427  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         1428  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         1429  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         1430  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         1431  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         1432  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         1433  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         1434  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         1435  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         1436  +  JJ bb 73   JJ bb 73   JJ bb 73}
   375   1437   
   376   1438   do_execsql_test 1.12.4 {
   377   1439     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   378         -} {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}
         1440  +} {AA aa 934   AA aa 934   AA aa 934   AA aa 934   AA bb 870   AA bb 870
         1441  +  AA bb 870   AA bb 870   BB aa 762   BB aa 762   BB aa 762   BB aa 762
         1442  +  BB aa 762   BB aa 762   BB bb 840   BB bb 840   BB bb 840   BB bb 840
         1443  +  BB bb 840   BB bb 840   CC aa 759   CC aa 759   CC aa 759   CC aa 759
         1444  +  CC bb 822   CC bb 822   DD aa 845   DD aa 845   DD aa 845   DD bb 959
         1445  +  DD bb 959   DD bb 959   DD bb 959   EE aa 777   EE aa 777   EE bb 768
         1446  +  EE bb 768   EE bb 768   FF aa 670   FF aa 670   FF aa 670   FF aa 670
         1447  +  FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938
         1448  +  GG aa 634   GG aa 634   GG aa 634   GG aa 634   GG bb 938   GG bb 938
         1449  +  GG bb 938   GG bb 938   HH aa 979   HH aa 979   HH aa 979   HH bb 963
         1450  +  HH bb 963   HH bb 963   HH bb 963   HH bb 963   HH bb 963   II aa 652
         1451  +  II aa 652   II bb 805   II bb 805   II bb 805   II bb 805   II bb 805
         1452  +  JJ aa 899   JJ aa 899   JJ aa 899   JJ aa 899   JJ bb 839   JJ bb 839
         1453  +  JJ bb 839   JJ bb 839}
   379   1454   
   380   1455   do_execsql_test 1.12.5 {
   381   1456     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   382         -} {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}
         1457  +} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 309   AA bb 309
         1458  +  AA bb 309   AA bb 309   BB aa 247   BB aa 247   BB aa 247   BB aa 247
         1459  +  BB aa 247   BB aa 247   BB bb 633   BB bb 633   BB bb 633   BB bb 633
         1460  +  BB bb 633   BB bb 633   CC aa 158   CC aa 158   CC aa 158   CC aa 158
         1461  +  CC bb 346   CC bb 346   DD aa 224   DD aa 224   DD aa 224   DD bb 238
         1462  +  DD bb 238   DD bb 238   DD bb 238   EE aa 113   EE aa 113   EE bb 252
         1463  +  EE bb 252   EE bb 252   FF aa 208   FF aa 208   FF aa 208   FF aa 208
         1464  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
         1465  +  GG aa 148   GG aa 148   GG aa 148   GG aa 148   GG bb 160   GG bb 160
         1466  +  GG bb 160   GG bb 160   HH aa 480   HH aa 480   HH aa 480   HH bb 133
         1467  +  HH bb 133   HH bb 133   HH bb 133   HH bb 133   HH bb 133   II aa 398
         1468  +  II aa 398   II bb 250   II bb 250   II bb 250   II bb 250   II bb 250
         1469  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 257   JJ bb 257
         1470  +  JJ bb 257   JJ bb 257}
   383   1471   
   384   1472   do_execsql_test 1.12.6 {
   385   1473     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;
   386         -} {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}
         1474  +} {AA aa 3751   AA aa 3774   AA aa 4446   AA aa 4462   AA bb 3815   AA bb 4058
         1475  +  AA bb 4113   AA bb 4376   BB aa 6578   BB aa 6680   BB aa 6928   BB aa 6941
         1476  +  BB aa 6947   BB aa 7093   BB bb 6500   BB bb 6548   BB bb 6554   BB bb 6629
         1477  +  BB bb 6635   BB bb 6707   CC aa 2363   CC aa 2515   CC aa 2692   CC aa 2964
         1478  +  CC bb 2300   CC bb 2776   DD aa 3187   DD aa 3776   DD aa 3808   DD bb 3073
         1479  +  DD bb 3238   DD bb 3316   DD bb 3794   EE aa 1762   EE aa 2426   EE bb 1771
         1480  +  EE bb 1910   EE bb 2287   FF aa 4998   FF aa 5001   FF aa 5050   FF aa 5460
         1481  +  FF bb 4730   FF bb 4798   FF bb 4942   FF bb 5094   FF bb 5373   FF bb 5566
         1482  +  GG aa 3834   GG aa 3988   GG aa 4133   GG aa 4320   GG bb 3530   GG bb 3539
         1483  +  GG bb 3624   GG bb 4308   HH aa 4464   HH aa 4653   HH aa 4963   HH bb 4480
         1484  +  HH bb 4713   HH bb 4760   HH bb 5088   HH bb 5113   HH bb 5310   II aa 2988
         1485  +  II aa 3242   II bb 2835   II bb 2969   II bb 3197   II bb 3219   II bb 3390
         1486  +  JJ aa 2901   JJ aa 3032   JJ aa 3566   JJ aa 3687   JJ bb 2961   JJ bb 3446
         1487  +  JJ bb 3464   JJ bb 3543}
   387   1488   
   388   1489   do_execsql_test 1.12.7 {
   389   1490     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;
   390         -} {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}
         1491  +} {AA aa 1373   AA aa 1396   AA aa 2068   AA aa 2084   AA bb 1508   AA bb 1751
         1492  +  AA bb 1806   AA bb 2069   BB aa 2111   BB aa 2213   BB aa 2461   BB aa 2474
         1493  +  BB aa 2480   BB aa 2626   BB bb 3627   BB bb 3675   BB bb 3681   BB bb 3756
         1494  +  BB bb 3762   BB bb 3834   CC aa 1195   CC aa 1347   CC aa 1524   CC aa 1796
         1495  +  CC bb 346   CC bb 822   DD aa 480   DD aa 1069   DD aa 1101   DD bb 1748
         1496  +  DD bb 1913   DD bb 1991   DD bb 2469   EE aa 113   EE aa 777   EE bb 881
         1497  +  EE bb 1020   EE bb 1397   FF aa 1493   FF aa 1496   FF aa 1545   FF aa 1955
         1498  +  FF bb 2567   FF bb 2635   FF bb 2779   FF bb 2931   FF bb 3210   FF bb 3403
         1499  +  GG aa 963   GG aa 1117   GG aa 1262   GG aa 1449   GG bb 1933   GG bb 1942
         1500  +  GG bb 2027   GG bb 2711   HH aa 1270   HH aa 1459   HH aa 1769   HH bb 2231
         1501  +  HH bb 2464   HH bb 2511   HH bb 2839   HH bb 2864   HH bb 3061   II aa 398
         1502  +  II aa 652   II bb 1785   II bb 1919   II bb 2147   II bb 2169   II bb 2340
         1503  +  JJ aa 1115   JJ aa 1246   JJ aa 1780   JJ aa 1901   JJ bb 947   JJ bb 1432
         1504  +  JJ bb 1450   JJ bb 1529}
   391   1505   
   392   1506   do_execsql_test 1.13.1 {
   393   1507     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN CURRENT ROW         AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   394         -} {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}
         1508  +} {AA aa 12025   AA aa 12025   AA aa 12025   AA aa 12025   AA bb 12025
         1509  +  AA bb 12025   AA bb 12025   AA bb 12025   BB aa 10462   BB aa 10462
         1510  +  BB aa 10462   BB aa 10462   BB aa 10462   BB aa 10462   BB bb 10462
         1511  +  BB bb 10462   BB bb 10462   BB bb 10462   BB bb 10462   BB bb 10462
         1512  +  CC aa 7154   CC aa 7154   CC aa 7154   CC aa 7154   CC bb 7154   CC bb 7154
         1513  +  DD aa 6571   DD aa 6571   DD aa 6571   DD bb 6571   DD bb 6571   DD bb 6571
         1514  +  DD bb 6571   EE aa 8207   EE aa 8207   EE bb 8207   EE bb 8207   EE bb 8207
         1515  +  FF aa 10136   FF aa 10136   FF aa 10136   FF aa 10136   FF bb 10136
         1516  +  FF bb 10136   FF bb 10136   FF bb 10136   FF bb 10136   FF bb 10136
         1517  +  GG aa 9911   GG aa 9911   GG aa 9911   GG aa 9911   GG bb 9911   GG bb 9911
         1518  +  GG bb 9911   GG bb 9911   HH aa 9083   HH aa 9083   HH aa 9083   HH bb 9083
         1519  +  HH bb 9083   HH bb 9083   HH bb 9083   HH bb 9083   HH bb 9083   II aa 7440
         1520  +  II aa 7440   II bb 7440   II bb 7440   II bb 7440   II bb 7440   II bb 7440
         1521  +  JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ bb 3800   JJ bb 3800
         1522  +  JJ bb 3800   JJ bb 3800}
   395   1523   
   396   1524   do_execsql_test 1.13.2 {
   397   1525     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   398         -} {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}
         1526  +} {AA aa 4685   AA aa 4685   AA aa 4685   AA aa 4685   AA bb 5251   AA bb 5251
         1527  +  AA bb 5251   AA bb 5251   BB aa 7340   BB aa 7340   BB aa 7340   BB aa 7340
         1528  +  BB aa 7340   BB aa 7340   BB bb 6421   BB bb 6421   BB bb 6421   BB bb 6421
         1529  +  BB bb 6421   BB bb 6421   CC aa 3122   CC aa 3122   CC aa 3122   CC aa 3122
         1530  +  CC bb 2493   CC bb 2493   DD aa 4032   DD aa 4032   DD aa 4032   DD bb 3597
         1531  +  DD bb 3597   DD bb 3597   DD bb 3597   EE aa 2539   EE aa 2539   EE bb 3812
         1532  +  EE bb 3812   EE bb 3812   FF aa 5668   FF aa 5668   FF aa 5668   FF aa 5668
         1533  +  FF bb 5102   FF bb 5102   FF bb 5102   FF bb 5102   FF bb 5102   FF bb 5102
         1534  +  GG aa 4468   GG aa 4468   GG aa 4468   GG aa 4468   GG bb 5120   GG bb 5120
         1535  +  GG bb 5120   GG bb 5120   HH aa 5443   HH aa 5443   HH aa 5443   HH bb 4244
         1536  +  HH bb 4244   HH bb 4244   HH bb 4244   HH bb 4244   HH bb 4244   II aa 3640
         1537  +  II aa 3640   II bb 4604   II bb 4604   II bb 4604   II bb 4604   II bb 4604
         1538  +  JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ bb 1786   JJ bb 1786
         1539  +  JJ bb 1786   JJ bb 1786}
   399   1540   
   400   1541   do_execsql_test 1.13.3 {
   401   1542     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN CURRENT ROW         AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   402         -} {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}
         1543  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         1544  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         1545  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         1546  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         1547  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         1548  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         1549  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         1550  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         1551  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         1552  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         1553  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         1554  +  JJ bb 73   JJ bb 73   JJ bb 73}
   403   1555   
   404   1556   do_execsql_test 1.13.4 {
   405   1557     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   406         -} {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}
         1558  +} {AA aa 934   AA aa 934   AA aa 934   AA aa 934   AA bb 870   AA bb 870
         1559  +  AA bb 870   AA bb 870   BB aa 840   BB aa 840   BB aa 840   BB aa 840
         1560  +  BB aa 840   BB aa 840   BB bb 840   BB bb 840   BB bb 840   BB bb 840
         1561  +  BB bb 840   BB bb 840   CC aa 822   CC aa 822   CC aa 822   CC aa 822
         1562  +  CC bb 845   CC bb 845   DD aa 959   DD aa 959   DD aa 959   DD bb 959
         1563  +  DD bb 959   DD bb 959   DD bb 959   EE aa 777   EE aa 777   EE bb 768
         1564  +  EE bb 768   EE bb 768   FF aa 938   FF aa 938   FF aa 938   FF aa 938
         1565  +  FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938
         1566  +  GG aa 938   GG aa 938   GG aa 938   GG aa 938   GG bb 979   GG bb 979
         1567  +  GG bb 979   GG bb 979   HH aa 979   HH aa 979   HH aa 979   HH bb 963
         1568  +  HH bb 963   HH bb 963   HH bb 963   HH bb 963   HH bb 963   II aa 805
         1569  +  II aa 805   II bb 899   II bb 899   II bb 899   II bb 899   II bb 899
         1570  +  JJ aa 899   JJ aa 899   JJ aa 899   JJ aa 899   JJ bb 839   JJ bb 839
         1571  +  JJ bb 839   JJ bb 839}
   407   1572   
   408   1573   do_execsql_test 1.13.5 {
   409   1574     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   410         -} {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}
         1575  +} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 247   AA bb 247
         1576  +  AA bb 247   AA bb 247   BB aa 247   BB aa 247   BB aa 247   BB aa 247
         1577  +  BB aa 247   BB aa 247   BB bb 158   BB bb 158   BB bb 158   BB bb 158
         1578  +  BB bb 158   BB bb 158   CC aa 158   CC aa 158   CC aa 158   CC aa 158
         1579  +  CC bb 224   CC bb 224   DD aa 224   DD aa 224   DD aa 224   DD bb 113
         1580  +  DD bb 113   DD bb 113   DD bb 113   EE aa 113   EE aa 113   EE bb 208
         1581  +  EE bb 208   EE bb 208   FF aa 102   FF aa 102   FF aa 102   FF aa 102
         1582  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
         1583  +  GG aa 148   GG aa 148   GG aa 148   GG aa 148   GG bb 160   GG bb 160
         1584  +  GG bb 160   GG bb 160   HH aa 133   HH aa 133   HH aa 133   HH bb 133
         1585  +  HH bb 133   HH bb 133   HH bb 133   HH bb 133   HH bb 133   II aa 250
         1586  +  II aa 250   II bb 113   II bb 113   II bb 113   II bb 113   II bb 113
         1587  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 257   JJ bb 257
         1588  +  JJ bb 257   JJ bb 257}
   411   1589   
   412   1590   do_execsql_test 1.13.6 {
   413   1591     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;
   414         -} {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}
         1592  +} {AA aa 11091   AA aa 11114   AA aa 11786   AA aa 11802   AA bb 11155
         1593  +  AA bb 11398   AA bb 11453   AA bb 11716   BB aa 9700   BB aa 9802
         1594  +  BB aa 10050   BB aa 10063   BB aa 10069   BB aa 10215   BB bb 9622
         1595  +  BB bb 9670   BB bb 9676   BB bb 9751   BB bb 9757   BB bb 9829   CC aa 6395
         1596  +  CC aa 6547   CC aa 6724   CC aa 6996   CC bb 6332   CC bb 6808   DD aa 5726
         1597  +  DD aa 6315   DD aa 6347   DD bb 5612   DD bb 5777   DD bb 5855   DD bb 6333
         1598  +  EE aa 7430   EE aa 8094   EE bb 7439   EE bb 7578   EE bb 7955   FF aa 9466
         1599  +  FF aa 9469   FF aa 9518   FF aa 9928   FF bb 9198   FF bb 9266   FF bb 9410
         1600  +  FF bb 9562   FF bb 9841   FF bb 10034   GG aa 9277   GG aa 9431
         1601  +  GG aa 9576   GG aa 9763   GG bb 8973   GG bb 8982   GG bb 9067   GG bb 9751
         1602  +  HH aa 8104   HH aa 8293   HH aa 8603   HH bb 8120   HH bb 8353   HH bb 8400
         1603  +  HH bb 8728   HH bb 8753   HH bb 8950   II aa 6788   II aa 7042   II bb 6635
         1604  +  II bb 6769   II bb 6997   II bb 7019   II bb 7190   JJ aa 2901   JJ aa 3032
         1605  +  JJ aa 3566   JJ aa 3687   JJ bb 2961   JJ bb 3446   JJ bb 3464   JJ bb 3543}
   415   1606   
   416   1607   do_execsql_test 1.13.7 {
   417   1608     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;
   418         -} {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}
         1609  +} {AA aa 3751   AA aa 3774   AA aa 4446   AA aa 4462   AA bb 4381   AA bb 4624
         1610  +  AA bb 4679   AA bb 4942   BB aa 6578   BB aa 6680   BB aa 6928   BB aa 6941
         1611  +  BB aa 6947   BB aa 7093   BB bb 5581   BB bb 5629   BB bb 5635   BB bb 5710
         1612  +  BB bb 5716   BB bb 5788   CC aa 2363   CC aa 2515   CC aa 2692   CC aa 2964
         1613  +  CC bb 1671   CC bb 2147   DD aa 3187   DD aa 3776   DD aa 3808   DD bb 2638
         1614  +  DD bb 2803   DD bb 2881   DD bb 3359   EE aa 1762   EE aa 2426   EE bb 3044
         1615  +  EE bb 3183   EE bb 3560   FF aa 4998   FF aa 5001   FF aa 5050   FF aa 5460
         1616  +  FF bb 4164   FF bb 4232   FF bb 4376   FF bb 4528   FF bb 4807   FF bb 5000
         1617  +  GG aa 3834   GG aa 3988   GG aa 4133   GG aa 4320   GG bb 4182   GG bb 4191
         1618  +  GG bb 4276   GG bb 4960   HH aa 4464   HH aa 4653   HH aa 4963   HH bb 3281
         1619  +  HH bb 3514   HH bb 3561   HH bb 3889   HH bb 3914   HH bb 4111   II aa 2988
         1620  +  II aa 3242   II bb 3799   II bb 3933   II bb 4161   II bb 4183   II bb 4354
         1621  +  JJ aa 2901   JJ aa 3032   JJ aa 3566   JJ aa 3687   JJ bb 947   JJ bb 1432
         1622  +  JJ bb 1450   JJ bb 1529}
   419   1623   
   420   1624   do_execsql_test 1.14.1 {
   421   1625     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN CURRENT ROW         AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   422         -} {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}
         1626  +} {AA aa 44737   AA aa 44737   AA aa 44737   AA aa 44737   AA bb 44737
         1627  +  AA bb 44737   AA bb 44737   AA bb 44737   BB aa 40052   BB aa 40052
         1628  +  BB aa 40052   BB aa 40052   BB aa 40052   BB aa 40052   BB bb 40052
         1629  +  BB bb 40052   BB bb 40052   BB bb 40052   BB bb 40052   BB bb 40052
         1630  +  CC aa 32712   CC aa 32712   CC aa 32712   CC aa 32712   CC bb 32712
         1631  +  CC bb 32712   DD aa 29590   DD aa 29590   DD aa 29590   DD bb 29590
         1632  +  DD bb 29590   DD bb 29590   DD bb 29590   EE aa 25558   EE aa 25558
         1633  +  EE bb 25558   EE bb 25558   EE bb 25558   FF aa 23019   FF aa 23019
         1634  +  FF aa 23019   FF aa 23019   FF bb 23019   FF bb 23019   FF bb 23019
         1635  +  FF bb 23019   FF bb 23019   FF bb 23019   GG aa 17351   GG aa 17351
         1636  +  GG aa 17351   GG aa 17351   GG bb 17351   GG bb 17351   GG bb 17351
         1637  +  GG bb 17351   HH aa 12883   HH aa 12883   HH aa 12883   HH bb 12883
         1638  +  HH bb 12883   HH bb 12883   HH bb 12883   HH bb 12883   HH bb 12883
         1639  +  II aa 7440   II aa 7440   II bb 7440   II bb 7440   II bb 7440   II bb 7440
         1640  +  II bb 7440   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ bb 3800
         1641  +  JJ bb 3800   JJ bb 3800   JJ bb 3800}
   423   1642   
   424   1643   do_execsql_test 1.14.2 {
   425   1644     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   426         -} {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}
         1645  +} {AA aa 44737   AA aa 44737   AA aa 44737   AA aa 44737   AA bb 42430
         1646  +  AA bb 42430   AA bb 42430   AA bb 42430   BB aa 40052   BB aa 40052
         1647  +  BB aa 40052   BB aa 40052   BB aa 40052   BB aa 40052   BB bb 37179
         1648  +  BB bb 37179   BB bb 37179   BB bb 37179   BB bb 37179   BB bb 37179
         1649  +  CC aa 32712   CC aa 32712   CC aa 32712   CC aa 32712   CC bb 30758
         1650  +  CC bb 30758   DD aa 29590   DD aa 29590   DD aa 29590   DD bb 28265
         1651  +  DD bb 28265   DD bb 28265   DD bb 28265   EE aa 25558   EE aa 25558
         1652  +  EE bb 24668   EE bb 24668   EE bb 24668   FF aa 23019   FF aa 23019
         1653  +  FF aa 23019   FF aa 23019   FF bb 20856   FF bb 20856   FF bb 20856
         1654  +  FF bb 20856   FF bb 20856   FF bb 20856   GG aa 17351   GG aa 17351
         1655  +  GG aa 17351   GG aa 17351   GG bb 15754   GG bb 15754   GG bb 15754
         1656  +  GG bb 15754   HH aa 12883   HH aa 12883   HH aa 12883   HH bb 10634
         1657  +  HH bb 10634   HH bb 10634   HH bb 10634   HH bb 10634   HH bb 10634
         1658  +  II aa 7440   II aa 7440   II bb 6390   II bb 6390   II bb 6390   II bb 6390
         1659  +  II bb 6390   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ bb 1786
         1660  +  JJ bb 1786   JJ bb 1786   JJ bb 1786}
   427   1661   
   428   1662   do_execsql_test 1.14.3 {
   429   1663     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN CURRENT ROW         AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   430         -} {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}
         1664  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         1665  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         1666  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         1667  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         1668  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         1669  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         1670  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         1671  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         1672  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         1673  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         1674  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         1675  +  JJ bb 73   JJ bb 73   JJ bb 73}
   431   1676   
   432   1677   do_execsql_test 1.14.4 {
   433   1678     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   434         -} {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}
         1679  +} {AA aa 979   AA aa 979   AA aa 979   AA aa 979   AA bb 979   AA bb 979
         1680  +  AA bb 979   AA bb 979   BB aa 979   BB aa 979   BB aa 979   BB aa 979
         1681  +  BB aa 979   BB aa 979   BB bb 979   BB bb 979   BB bb 979   BB bb 979
         1682  +  BB bb 979   BB bb 979   CC aa 979   CC aa 979   CC aa 979   CC aa 979
         1683  +  CC bb 979   CC bb 979   DD aa 979   DD aa 979   DD aa 979   DD bb 979
         1684  +  DD bb 979   DD bb 979   DD bb 979   EE aa 979   EE aa 979   EE bb 979
         1685  +  EE bb 979   EE bb 979   FF aa 979   FF aa 979   FF aa 979   FF aa 979
         1686  +  FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979
         1687  +  GG aa 979   GG aa 979   GG aa 979   GG aa 979   GG bb 979   GG bb 979
         1688  +  GG bb 979   GG bb 979   HH aa 979   HH aa 979   HH aa 979   HH bb 963
         1689  +  HH bb 963   HH bb 963   HH bb 963   HH bb 963   HH bb 963   II aa 899
         1690  +  II aa 899   II bb 899   II bb 899   II bb 899   II bb 899   II bb 899
         1691  +  JJ aa 899   JJ aa 899   JJ aa 899   JJ aa 899   JJ bb 839   JJ bb 839
         1692  +  JJ bb 839   JJ bb 839}
   435   1693   
   436   1694   do_execsql_test 1.14.5 {
   437   1695     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   438         -} {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}
         1696  +} {AA aa 102   AA aa 102   AA aa 102   AA aa 102   AA bb 102   AA bb 102
         1697  +  AA bb 102   AA bb 102   BB aa 102   BB aa 102   BB aa 102   BB aa 102
         1698  +  BB aa 102   BB aa 102   BB bb 102   BB bb 102   BB bb 102   BB bb 102
         1699  +  BB bb 102   BB bb 102   CC aa 102   CC aa 102   CC aa 102   CC aa 102
         1700  +  CC bb 102   CC bb 102   DD aa 102   DD aa 102   DD aa 102   DD bb 102
         1701  +  DD bb 102   DD bb 102   DD bb 102   EE aa 102   EE aa 102   EE bb 102
         1702  +  EE bb 102   EE bb 102   FF aa 102   FF aa 102   FF aa 102   FF aa 102
         1703  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
         1704  +  GG aa 113   GG aa 113   GG aa 113   GG aa 113   GG bb 113   GG bb 113
         1705  +  GG bb 113   GG bb 113   HH aa 113   HH aa 113   HH aa 113   HH bb 113
         1706  +  HH bb 113   HH bb 113   HH bb 113   HH bb 113   HH bb 113   II aa 113
         1707  +  II aa 113   II bb 113   II bb 113   II bb 113   II bb 113   II bb 113
         1708  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 257   JJ bb 257
         1709  +  JJ bb 257   JJ bb 257}
   439   1710   
   440   1711   do_execsql_test 1.14.6 {
   441   1712     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;
   442         -} {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}
         1713  +} {AA aa 43803   AA aa 43826   AA aa 44498   AA aa 44514   AA bb 43867
         1714  +  AA bb 44110   AA bb 44165   AA bb 44428   BB aa 39290   BB aa 39392
         1715  +  BB aa 39640   BB aa 39653   BB aa 39659   BB aa 39805   BB bb 39212
         1716  +  BB bb 39260   BB bb 39266   BB bb 39341   BB bb 39347   BB bb 39419
         1717  +  CC aa 31953   CC aa 32105   CC aa 32282   CC aa 32554   CC bb 31890
         1718  +  CC bb 32366   DD aa 28745   DD aa 29334   DD aa 29366   DD bb 28631
         1719  +  DD bb 28796   DD bb 28874   DD bb 29352   EE aa 24781   EE aa 25445
         1720  +  EE bb 24790   EE bb 24929   EE bb 25306   FF aa 22349   FF aa 22352
         1721  +  FF aa 22401   FF aa 22811   FF bb 22081   FF bb 22149   FF bb 22293
         1722  +  FF bb 22445   FF bb 22724   FF bb 22917   GG aa 16717   GG aa 16871
         1723  +  GG aa 17016   GG aa 17203   GG bb 16413   GG bb 16422   GG bb 16507
         1724  +  GG bb 17191   HH aa 11904   HH aa 12093   HH aa 12403   HH bb 11920
         1725  +  HH bb 12153   HH bb 12200   HH bb 12528   HH bb 12553   HH bb 12750
         1726  +  II aa 6788   II aa 7042   II bb 6635   II bb 6769   II bb 6997   II bb 7019
         1727  +  II bb 7190   JJ aa 2901   JJ aa 3032   JJ aa 3566   JJ aa 3687   JJ bb 2961
         1728  +  JJ bb 3446   JJ bb 3464   JJ bb 3543}
   443   1729   
   444   1730   do_execsql_test 1.14.7 {
   445   1731     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;
   446         -} {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}
         1732  +} {AA aa 43803   AA aa 43826   AA aa 44498   AA aa 44514   AA bb 41560
         1733  +  AA bb 41803   AA bb 41858   AA bb 42121   BB aa 39290   BB aa 39392
         1734  +  BB aa 39640   BB aa 39653   BB aa 39659   BB aa 39805   BB bb 36339
         1735  +  BB bb 36387   BB bb 36393   BB bb 36468   BB bb 36474   BB bb 36546
         1736  +  CC aa 31953   CC aa 32105   CC aa 32282   CC aa 32554   CC bb 29936
         1737  +  CC bb 30412   DD aa 28745   DD aa 29334   DD aa 29366   DD bb 27306
         1738  +  DD bb 27471   DD bb 27549   DD bb 28027   EE aa 24781   EE aa 25445
         1739  +  EE bb 23900   EE bb 24039   EE bb 24416   FF aa 22349   FF aa 22352
         1740  +  FF aa 22401   FF aa 22811   FF bb 19918   FF bb 19986   FF bb 20130
         1741  +  FF bb 20282   FF bb 20561   FF bb 20754   GG aa 16717   GG aa 16871
         1742  +  GG aa 17016   GG aa 17203   GG bb 14816   GG bb 14825   GG bb 14910
         1743  +  GG bb 15594   HH aa 11904   HH aa 12093   HH aa 12403   HH bb 9671
         1744  +  HH bb 9904   HH bb 9951   HH bb 10279   HH bb 10304   HH bb 10501
         1745  +  II aa 6788   II aa 7042   II bb 5585   II bb 5719   II bb 5947   II bb 5969
         1746  +  II bb 6140   JJ aa 2901   JJ aa 3032   JJ aa 3566   JJ aa 3687   JJ bb 947
         1747  +  JJ bb 1432   JJ bb 1450   JJ bb 1529}
   447   1748   
   448   1749   do_execsql_test 1.15.1 {
   449   1750     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   450         -} {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}
         1751  +} {AA aa 44737   AA aa 44737   AA aa 44737   AA aa 44737   AA bb 44737
         1752  +  AA bb 44737   AA bb 44737   AA bb 44737   BB aa 40052   BB aa 40052
         1753  +  BB aa 40052   BB aa 40052   BB aa 40052   BB aa 40052   BB bb 40052
         1754  +  BB bb 40052   BB bb 40052   BB bb 40052   BB bb 40052   BB bb 40052
         1755  +  CC aa 32712   CC aa 32712   CC aa 32712   CC aa 32712   CC bb 32712
         1756  +  CC bb 32712   DD aa 29590   DD aa 29590   DD aa 29590   DD bb 29590
         1757  +  DD bb 29590   DD bb 29590   DD bb 29590   EE aa 25558   EE aa 25558
         1758  +  EE bb 25558   EE bb 25558   EE bb 25558   FF aa 23019   FF aa 23019
         1759  +  FF aa 23019   FF aa 23019   FF bb 23019   FF bb 23019   FF bb 23019
         1760  +  FF bb 23019   FF bb 23019   FF bb 23019   GG aa 17351   GG aa 17351
         1761  +  GG aa 17351   GG aa 17351   GG bb 17351   GG bb 17351   GG bb 17351
         1762  +  GG bb 17351   HH aa 12883   HH aa 12883   HH aa 12883   HH bb 12883
         1763  +  HH bb 12883   HH bb 12883   HH bb 12883   HH bb 12883   HH bb 12883
         1764  +  II aa 7440   II aa 7440   II bb 7440   II bb 7440   II bb 7440   II bb 7440
         1765  +  II bb 7440   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ bb 3800
         1766  +  JJ bb 3800   JJ bb 3800   JJ bb 3800}
   451   1767   
   452   1768   do_execsql_test 1.15.2 {
   453   1769     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   454         -} {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}
         1770  +} {AA aa 44737   AA aa 44737   AA aa 44737   AA aa 44737   AA bb 42430
         1771  +  AA bb 42430   AA bb 42430   AA bb 42430   BB aa 40052   BB aa 40052
         1772  +  BB aa 40052   BB aa 40052   BB aa 40052   BB aa 40052   BB bb 37179
         1773  +  BB bb 37179   BB bb 37179   BB bb 37179   BB bb 37179   BB bb 37179
         1774  +  CC aa 32712   CC aa 32712   CC aa 32712   CC aa 32712   CC bb 30758
         1775  +  CC bb 30758   DD aa 29590   DD aa 29590   DD aa 29590   DD bb 28265
         1776  +  DD bb 28265   DD bb 28265   DD bb 28265   EE aa 25558   EE aa 25558
         1777  +  EE bb 24668   EE bb 24668   EE bb 24668   FF aa 23019   FF aa 23019
         1778  +  FF aa 23019   FF aa 23019   FF bb 20856   FF bb 20856   FF bb 20856
         1779  +  FF bb 20856   FF bb 20856   FF bb 20856   GG aa 17351   GG aa 17351
         1780  +  GG aa 17351   GG aa 17351   GG bb 15754   GG bb 15754   GG bb 15754
         1781  +  GG bb 15754   HH aa 12883   HH aa 12883   HH aa 12883   HH bb 10634
         1782  +  HH bb 10634   HH bb 10634   HH bb 10634   HH bb 10634   HH bb 10634
         1783  +  II aa 7440   II aa 7440   II bb 6390   II bb 6390   II bb 6390   II bb 6390
         1784  +  II bb 6390   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ bb 1786
         1785  +  JJ bb 1786   JJ bb 1786   JJ bb 1786}
   455   1786   
   456   1787   do_execsql_test 1.15.3 {
   457   1788     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   458         -} {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}
         1789  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         1790  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         1791  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         1792  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         1793  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         1794  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         1795  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         1796  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         1797  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         1798  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         1799  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         1800  +  JJ bb 73   JJ bb 73   JJ bb 73}
   459   1801   
   460   1802   do_execsql_test 1.15.4 {
   461   1803     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   462         -} {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}
         1804  +} {AA aa 979   AA aa 979   AA aa 979   AA aa 979   AA bb 979   AA bb 979
         1805  +  AA bb 979   AA bb 979   BB aa 979   BB aa 979   BB aa 979   BB aa 979
         1806  +  BB aa 979   BB aa 979   BB bb 979   BB bb 979   BB bb 979   BB bb 979
         1807  +  BB bb 979   BB bb 979   CC aa 979   CC aa 979   CC aa 979   CC aa 979
         1808  +  CC bb 979   CC bb 979   DD aa 979   DD aa 979   DD aa 979   DD bb 979
         1809  +  DD bb 979   DD bb 979   DD bb 979   EE aa 979   EE aa 979   EE bb 979
         1810  +  EE bb 979   EE bb 979   FF aa 979   FF aa 979   FF aa 979   FF aa 979
         1811  +  FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979
         1812  +  GG aa 979   GG aa 979   GG aa 979   GG aa 979   GG bb 979   GG bb 979
         1813  +  GG bb 979   GG bb 979   HH aa 979   HH aa 979   HH aa 979   HH bb 963
         1814  +  HH bb 963   HH bb 963   HH bb 963   HH bb 963   HH bb 963   II aa 899
         1815  +  II aa 899   II bb 899   II bb 899   II bb 899   II bb 899   II bb 899
         1816  +  JJ aa 899   JJ aa 899   JJ aa 899   JJ aa 899   JJ bb 839   JJ bb 839
         1817  +  JJ bb 839   JJ bb 839}
   463   1818   
   464   1819   do_execsql_test 1.15.5 {
   465   1820     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   466         -} {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}
         1821  +} {AA aa 102   AA aa 102   AA aa 102   AA aa 102   AA bb 102   AA bb 102
         1822  +  AA bb 102   AA bb 102   BB aa 102   BB aa 102   BB aa 102   BB aa 102
         1823  +  BB aa 102   BB aa 102   BB bb 102   BB bb 102   BB bb 102   BB bb 102
         1824  +  BB bb 102   BB bb 102   CC aa 102   CC aa 102   CC aa 102   CC aa 102
         1825  +  CC bb 102   CC bb 102   DD aa 102   DD aa 102   DD aa 102   DD bb 102
         1826  +  DD bb 102   DD bb 102   DD bb 102   EE aa 102   EE aa 102   EE bb 102
         1827  +  EE bb 102   EE bb 102   FF aa 102   FF aa 102   FF aa 102   FF aa 102
         1828  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
         1829  +  GG aa 113   GG aa 113   GG aa 113   GG aa 113   GG bb 113   GG bb 113
         1830  +  GG bb 113   GG bb 113   HH aa 113   HH aa 113   HH aa 113   HH bb 113
         1831  +  HH bb 113   HH bb 113   HH bb 113   HH bb 113   HH bb 113   II aa 113
         1832  +  II aa 113   II bb 113   II bb 113   II bb 113   II bb 113   II bb 113
         1833  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 257   JJ bb 257
         1834  +  JJ bb 257   JJ bb 257}
   467   1835   
   468   1836   do_execsql_test 1.15.6 {
   469   1837     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;
   470         -} {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}
         1838  +} {AA aa 43803   AA aa 43826   AA aa 44498   AA aa 44514   AA bb 43867
         1839  +  AA bb 44110   AA bb 44165   AA bb 44428   BB aa 39290   BB aa 39392
         1840  +  BB aa 39640   BB aa 39653   BB aa 39659   BB aa 39805   BB bb 39212
         1841  +  BB bb 39260   BB bb 39266   BB bb 39341   BB bb 39347   BB bb 39419
         1842  +  CC aa 31953   CC aa 32105   CC aa 32282   CC aa 32554   CC bb 31890
         1843  +  CC bb 32366   DD aa 28745   DD aa 29334   DD aa 29366   DD bb 28631
         1844  +  DD bb 28796   DD bb 28874   DD bb 29352   EE aa 24781   EE aa 25445
         1845  +  EE bb 24790   EE bb 24929   EE bb 25306   FF aa 22349   FF aa 22352
         1846  +  FF aa 22401   FF aa 22811   FF bb 22081   FF bb 22149   FF bb 22293
         1847  +  FF bb 22445   FF bb 22724   FF bb 22917   GG aa 16717   GG aa 16871
         1848  +  GG aa 17016   GG aa 17203   GG bb 16413   GG bb 16422   GG bb 16507
         1849  +  GG bb 17191   HH aa 11904   HH aa 12093   HH aa 12403   HH bb 11920
         1850  +  HH bb 12153   HH bb 12200   HH bb 12528   HH bb 12553   HH bb 12750
         1851  +  II aa 6788   II aa 7042   II bb 6635   II bb 6769   II bb 6997   II bb 7019
         1852  +  II bb 7190   JJ aa 2901   JJ aa 3032   JJ aa 3566   JJ aa 3687   JJ bb 2961
         1853  +  JJ bb 3446   JJ bb 3464   JJ bb 3543}
   471   1854   
   472   1855   do_execsql_test 1.15.7 {
   473   1856     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;
   474         -} {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}
         1857  +} {AA aa 43803   AA aa 43826   AA aa 44498   AA aa 44514   AA bb 41560
         1858  +  AA bb 41803   AA bb 41858   AA bb 42121   BB aa 39290   BB aa 39392
         1859  +  BB aa 39640   BB aa 39653   BB aa 39659   BB aa 39805   BB bb 36339
         1860  +  BB bb 36387   BB bb 36393   BB bb 36468   BB bb 36474   BB bb 36546
         1861  +  CC aa 31953   CC aa 32105   CC aa 32282   CC aa 32554   CC bb 29936
         1862  +  CC bb 30412   DD aa 28745   DD aa 29334   DD aa 29366   DD bb 27306
         1863  +  DD bb 27471   DD bb 27549   DD bb 28027   EE aa 24781   EE aa 25445
         1864  +  EE bb 23900   EE bb 24039   EE bb 24416   FF aa 22349   FF aa 22352
         1865  +  FF aa 22401   FF aa 22811   FF bb 19918   FF bb 19986   FF bb 20130
         1866  +  FF bb 20282   FF bb 20561   FF bb 20754   GG aa 16717   GG aa 16871
         1867  +  GG aa 17016   GG aa 17203   GG bb 14816   GG bb 14825   GG bb 14910
         1868  +  GG bb 15594   HH aa 11904   HH aa 12093   HH aa 12403   HH bb 9671
         1869  +  HH bb 9904   HH bb 9951   HH bb 10279   HH bb 10304   HH bb 10501
         1870  +  II aa 6788   II aa 7042   II bb 5585   II bb 5719   II bb 5947   II bb 5969
         1871  +  II bb 6140   JJ aa 2901   JJ aa 3032   JJ aa 3566   JJ aa 3687   JJ bb 947
         1872  +  JJ bb 1432   JJ bb 1450   JJ bb 1529}
   475   1873   
   476   1874   do_execsql_test 1.16.1 {
   477   1875     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 0 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   478         -} {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}
         1876  +} {AA aa 4685   AA aa 4685   AA aa 4685   AA aa 4685   AA bb 4685   AA bb 4685
         1877  +  AA bb 4685   AA bb 4685   BB aa 7340   BB aa 7340   BB aa 7340   BB aa 7340
         1878  +  BB aa 7340   BB aa 7340   BB bb 7340   BB bb 7340   BB bb 7340   BB bb 7340
         1879  +  BB bb 7340   BB bb 7340   CC aa 3122   CC aa 3122   CC aa 3122   CC aa 3122
         1880  +  CC bb 3122   CC bb 3122   DD aa 4032   DD aa 4032   DD aa 4032   DD bb 4032
         1881  +  DD bb 4032   DD bb 4032   DD bb 4032   EE aa 2539   EE aa 2539   EE bb 2539
         1882  +  EE bb 2539   EE bb 2539   FF aa 5668   FF aa 5668   FF aa 5668   FF aa 5668
         1883  +  FF bb 5668   FF bb 5668   FF bb 5668   FF bb 5668   FF bb 5668   FF bb 5668
         1884  +  GG aa 4468   GG aa 4468   GG aa 4468   GG aa 4468   GG bb 4468   GG bb 4468
         1885  +  GG bb 4468   GG bb 4468   HH aa 5443   HH aa 5443   HH aa 5443   HH bb 5443
         1886  +  HH bb 5443   HH bb 5443   HH bb 5443   HH bb 5443   HH bb 5443   II aa 3640
         1887  +  II aa 3640   II bb 3640   II bb 3640   II bb 3640   II bb 3640   II bb 3640
         1888  +  JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ aa 3800   JJ bb 3800   JJ bb 3800
         1889  +  JJ bb 3800   JJ bb 3800}
   479   1890   
   480   1891   do_execsql_test 1.16.2 {
   481   1892     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 0 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   482         -} {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}
         1893  +} {AA aa 2307   AA aa 2307   AA aa 2307   AA aa 2307   AA bb 2378   AA bb 2378
         1894  +  AA bb 2378   AA bb 2378   BB aa 2873   BB aa 2873   BB aa 2873   BB aa 2873
         1895  +  BB aa 2873   BB aa 2873   BB bb 4467   BB bb 4467   BB bb 4467   BB bb 4467
         1896  +  BB bb 4467   BB bb 4467   CC aa 1954   CC aa 1954   CC aa 1954   CC aa 1954
         1897  +  CC bb 1168   CC bb 1168   DD aa 1325   DD aa 1325   DD aa 1325   DD bb 2707
         1898  +  DD bb 2707   DD bb 2707   DD bb 2707   EE aa 890   EE aa 890   EE bb 1649
         1899  +  EE bb 1649   EE bb 1649   FF aa 2163   FF aa 2163   FF aa 2163   FF aa 2163
         1900  +  FF bb 3505   FF bb 3505   FF bb 3505   FF bb 3505   FF bb 3505   FF bb 3505
         1901  +  GG aa 1597   GG aa 1597   GG aa 1597   GG aa 1597   GG bb 2871   GG bb 2871
         1902  +  GG bb 2871   GG bb 2871   HH aa 2249   HH aa 2249   HH aa 2249   HH bb 3194
         1903  +  HH bb 3194   HH bb 3194   HH bb 3194   HH bb 3194   HH bb 3194   II aa 1050
         1904  +  II aa 1050   II bb 2590   II bb 2590   II bb 2590   II bb 2590   II bb 2590
         1905  +  JJ aa 2014   JJ aa 2014   JJ aa 2014   JJ aa 2014   JJ bb 1786   JJ bb 1786
         1906  +  JJ bb 1786   JJ bb 1786}
   483   1907   
   484   1908   do_execsql_test 1.16.3 {
   485   1909     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 0 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   486         -} {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}
         1910  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         1911  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         1912  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         1913  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         1914  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         1915  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         1916  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         1917  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         1918  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         1919  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         1920  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         1921  +  JJ bb 73   JJ bb 73   JJ bb 73}
   487   1922   
   488   1923   do_execsql_test 1.16.4 {
   489   1924     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 0 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   490         -} {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}
         1925  +} {AA aa 934   AA aa 934   AA aa 934   AA aa 934   AA bb 870   AA bb 870
         1926  +  AA bb 870   AA bb 870   BB aa 762   BB aa 762   BB aa 762   BB aa 762
         1927  +  BB aa 762   BB aa 762   BB bb 840   BB bb 840   BB bb 840   BB bb 840
         1928  +  BB bb 840   BB bb 840   CC aa 759   CC aa 759   CC aa 759   CC aa 759
         1929  +  CC bb 822   CC bb 822   DD aa 845   DD aa 845   DD aa 845   DD bb 959
         1930  +  DD bb 959   DD bb 959   DD bb 959   EE aa 777   EE aa 777   EE bb 768
         1931  +  EE bb 768   EE bb 768   FF aa 670   FF aa 670   FF aa 670   FF aa 670
         1932  +  FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938   FF bb 938
         1933  +  GG aa 634   GG aa 634   GG aa 634   GG aa 634   GG bb 938   GG bb 938
         1934  +  GG bb 938   GG bb 938   HH aa 979   HH aa 979   HH aa 979   HH bb 963
         1935  +  HH bb 963   HH bb 963   HH bb 963   HH bb 963   HH bb 963   II aa 652
         1936  +  II aa 652   II bb 805   II bb 805   II bb 805   II bb 805   II bb 805
         1937  +  JJ aa 899   JJ aa 899   JJ aa 899   JJ aa 899   JJ bb 839   JJ bb 839
         1938  +  JJ bb 839   JJ bb 839}
   491   1939   
   492   1940   do_execsql_test 1.16.5 {
   493   1941     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 0 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   494         -} {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}
         1942  +} {AA aa 223   AA aa 223   AA aa 223   AA aa 223   AA bb 309   AA bb 309
         1943  +  AA bb 309   AA bb 309   BB aa 247   BB aa 247   BB aa 247   BB aa 247
         1944  +  BB aa 247   BB aa 247   BB bb 633   BB bb 633   BB bb 633   BB bb 633
         1945  +  BB bb 633   BB bb 633   CC aa 158   CC aa 158   CC aa 158   CC aa 158
         1946  +  CC bb 346   CC bb 346   DD aa 224   DD aa 224   DD aa 224   DD bb 238
         1947  +  DD bb 238   DD bb 238   DD bb 238   EE aa 113   EE aa 113   EE bb 252
         1948  +  EE bb 252   EE bb 252   FF aa 208   FF aa 208   FF aa 208   FF aa 208
         1949  +  FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102   FF bb 102
         1950  +  GG aa 148   GG aa 148   GG aa 148   GG aa 148   GG bb 160   GG bb 160
         1951  +  GG bb 160   GG bb 160   HH aa 480   HH aa 480   HH aa 480   HH bb 133
         1952  +  HH bb 133   HH bb 133   HH bb 133   HH bb 133   HH bb 133   II aa 398
         1953  +  II aa 398   II bb 250   II bb 250   II bb 250   II bb 250   II bb 250
         1954  +  JJ aa 113   JJ aa 113   JJ aa 113   JJ aa 113   JJ bb 257   JJ bb 257
         1955  +  JJ bb 257   JJ bb 257}
   495   1956   
   496   1957   do_execsql_test 1.16.6 {
   497   1958     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;
   498         -} {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}
         1959  +} {AA aa 3751   AA aa 3774   AA aa 4446   AA aa 4462   AA bb 3815   AA bb 4058
         1960  +  AA bb 4113   AA bb 4376   BB aa 6578   BB aa 6680   BB aa 6928   BB aa 6941
         1961  +  BB aa 6947   BB aa 7093   BB bb 6500   BB bb 6548   BB bb 6554   BB bb 6629
         1962  +  BB bb 6635   BB bb 6707   CC aa 2363   CC aa 2515   CC aa 2692   CC aa 2964
         1963  +  CC bb 2300   CC bb 2776   DD aa 3187   DD aa 3776   DD aa 3808   DD bb 3073
         1964  +  DD bb 3238   DD bb 3316   DD bb 3794   EE aa 1762   EE aa 2426   EE bb 1771
         1965  +  EE bb 1910   EE bb 2287   FF aa 4998   FF aa 5001   FF aa 5050   FF aa 5460
         1966  +  FF bb 4730   FF bb 4798   FF bb 4942   FF bb 5094   FF bb 5373   FF bb 5566
         1967  +  GG aa 3834   GG aa 3988   GG aa 4133   GG aa 4320   GG bb 3530   GG bb 3539
         1968  +  GG bb 3624   GG bb 4308   HH aa 4464   HH aa 4653   HH aa 4963   HH bb 4480
         1969  +  HH bb 4713   HH bb 4760   HH bb 5088   HH bb 5113   HH bb 5310   II aa 2988
         1970  +  II aa 3242   II bb 2835   II bb 2969   II bb 3197   II bb 3219   II bb 3390
         1971  +  JJ aa 2901   JJ aa 3032   JJ aa 3566   JJ aa 3687   JJ bb 2961   JJ bb 3446
         1972  +  JJ bb 3464   JJ bb 3543}
   499   1973   
   500   1974   do_execsql_test 1.16.7 {
   501   1975     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;
   502         -} {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}
         1976  +} {AA aa 1373   AA aa 1396   AA aa 2068   AA aa 2084   AA bb 1508   AA bb 1751
         1977  +  AA bb 1806   AA bb 2069   BB aa 2111   BB aa 2213   BB aa 2461   BB aa 2474
         1978  +  BB aa 2480   BB aa 2626   BB bb 3627   BB bb 3675   BB bb 3681   BB bb 3756
         1979  +  BB bb 3762   BB bb 3834   CC aa 1195   CC aa 1347   CC aa 1524   CC aa 1796
         1980  +  CC bb 346   CC bb 822   DD aa 480   DD aa 1069   DD aa 1101   DD bb 1748
         1981  +  DD bb 1913   DD bb 1991   DD bb 2469   EE aa 113   EE aa 777   EE bb 881
         1982  +  EE bb 1020   EE bb 1397   FF aa 1493   FF aa 1496   FF aa 1545   FF aa 1955
         1983  +  FF bb 2567   FF bb 2635   FF bb 2779   FF bb 2931   FF bb 3210   FF bb 3403
         1984  +  GG aa 963   GG aa 1117   GG aa 1262   GG aa 1449   GG bb 1933   GG bb 1942
         1985  +  GG bb 2027   GG bb 2711   HH aa 1270   HH aa 1459   HH aa 1769   HH bb 2231
         1986  +  HH bb 2464   HH bb 2511   HH bb 2839   HH bb 2864   HH bb 3061   II aa 398
         1987  +  II aa 652   II bb 1785   II bb 1919   II bb 2147   II bb 2169   II bb 2340
         1988  +  JJ aa 1115   JJ aa 1246   JJ aa 1780   JJ aa 1901   JJ bb 947   JJ bb 1432
         1989  +  JJ bb 1450   JJ bb 1529}
   503   1990   
   504   1991   do_execsql_test 1.17.1 {
   505   1992     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 1 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   506         -} {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 {}}
         1993  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
         1994  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
         1995  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
         1996  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
         1997  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
         1998  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
         1999  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
         2000  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
         2001  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
         2002  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
         2003  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
         2004  +  JJ bb {}   JJ bb {}   JJ bb {}}
   507   2005   
   508   2006   do_execsql_test 1.17.2 {
   509   2007     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   510         -} {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 {}}
         2008  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
         2009  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
         2010  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
         2011  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
         2012  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
         2013  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
         2014  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
         2015  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
         2016  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
         2017  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
         2018  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
         2019  +  JJ bb {}   JJ bb {}   JJ bb {}}
   511   2020   
   512   2021   do_execsql_test 1.17.3 {
   513   2022     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 1 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   514         -} {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}
         2023  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         2024  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         2025  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         2026  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         2027  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         2028  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         2029  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         2030  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         2031  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         2032  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         2033  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         2034  +  JJ bb 73   JJ bb 73   JJ bb 73}
   515   2035   
   516   2036   do_execsql_test 1.17.4 {
   517   2037     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   518         -} {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 {}}
         2038  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
         2039  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
         2040  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
         2041  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
         2042  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
         2043  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
         2044  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
         2045  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
         2046  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
         2047  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
         2048  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
         2049  +  JJ bb {}   JJ bb {}   JJ bb {}}
   519   2050   
   520   2051   do_execsql_test 1.17.5 {
   521   2052     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   522         -} {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 {}}
         2053  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
         2054  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
         2055  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
         2056  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
         2057  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
         2058  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
         2059  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
         2060  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
         2061  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
         2062  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
         2063  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
         2064  +  JJ bb {}   JJ bb {}   JJ bb {}}
   523   2065   
   524   2066   do_execsql_test 1.17.6 {
   525   2067     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;
   526         -} {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 {}}
         2068  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
         2069  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
         2070  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
         2071  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
         2072  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
         2073  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
         2074  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
         2075  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
         2076  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
         2077  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
         2078  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
         2079  +  JJ bb {}   JJ bb {}   JJ bb {}}
   527   2080   
   528   2081   do_execsql_test 1.17.7 {
   529   2082     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;
   530         -} {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 {}}
         2083  +} {AA aa {}   AA aa {}   AA aa {}   AA aa {}   AA bb {}   AA bb {}   AA bb {}
         2084  +  AA bb {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}   BB aa {}
         2085  +  BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   BB bb {}   CC aa {}
         2086  +  CC aa {}   CC aa {}   CC aa {}   CC bb {}   CC bb {}   DD aa {}   DD aa {}
         2087  +  DD aa {}   DD bb {}   DD bb {}   DD bb {}   DD bb {}   EE aa {}   EE aa {}
         2088  +  EE bb {}   EE bb {}   EE bb {}   FF aa {}   FF aa {}   FF aa {}   FF aa {}
         2089  +  FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   FF bb {}   GG aa {}
         2090  +  GG aa {}   GG aa {}   GG aa {}   GG bb {}   GG bb {}   GG bb {}   GG bb {}
         2091  +  HH aa {}   HH aa {}   HH aa {}   HH bb {}   HH bb {}   HH bb {}   HH bb {}
         2092  +  HH bb {}   HH bb {}   II aa {}   II aa {}   II bb {}   II bb {}   II bb {}
         2093  +  II bb {}   II bb {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}
         2094  +  JJ bb {}   JJ bb {}   JJ bb {}}
   531   2095   
   532   2096   do_execsql_test 1.18.1 {
   533   2097     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 1 FOLLOWING         AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   534         -} {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 {}}
         2098  +} {AA aa 22701   AA aa 22701   AA aa 22701   AA aa 22701   AA bb 22701
         2099  +  AA bb 22701   AA bb 22701   AA bb 22701   BB aa 19829   BB aa 19829
         2100  +  BB aa 19829   BB aa 19829   BB aa 19829   BB aa 19829   BB bb 19829
         2101  +  BB bb 19829   BB bb 19829   BB bb 19829   BB bb 19829   BB bb 19829
         2102  +  CC aa 22150   CC aa 22150   CC aa 22150   CC aa 22150   CC bb 22150
         2103  +  CC bb 22150   DD aa 21758   DD aa 21758   DD aa 21758   DD bb 21758
         2104  +  DD bb 21758   DD bb 21758   DD bb 21758   EE aa 23019   EE aa 23019
         2105  +  EE bb 23019   EE bb 23019   EE bb 23019   FF aa 17351   FF aa 17351
         2106  +  FF aa 17351   FF aa 17351   FF bb 17351   FF bb 17351   FF bb 17351
         2107  +  FF bb 17351   FF bb 17351   FF bb 17351   GG aa 12883   GG aa 12883
         2108  +  GG aa 12883   GG aa 12883   GG bb 12883   GG bb 12883   GG bb 12883
         2109  +  GG bb 12883   HH aa 7440   HH aa 7440   HH aa 7440   HH bb 7440
         2110  +  HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   II aa 3800
         2111  +  II aa 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800
         2112  +  JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}   JJ bb {}   JJ bb {}
         2113  +  JJ bb {}}
   535   2114   
   536   2115   do_execsql_test 1.18.2 {
   537   2116     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   538         -} {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 {}}
         2117  +} {AA aa 12840   AA aa 12840   AA aa 12840   AA aa 12840   AA bb 11787
         2118  +  AA bb 11787   AA bb 11787   AA bb 11787   BB aa 11621   BB aa 11621
         2119  +  BB aa 11621   BB aa 11621   BB aa 11621   BB aa 11621   BB bb 8044
         2120  +  BB bb 8044   BB bb 8044   BB bb 8044   BB bb 8044   BB bb 8044   CC aa 7739
         2121  +  CC aa 7739   CC aa 7739   CC aa 7739   CC bb 8734   CC bb 8734
         2122  +  DD aa 10914   DD aa 10914   DD aa 10914   DD bb 9804   DD bb 9804
         2123  +  DD bb 9804   DD bb 9804   EE aa 11785   EE aa 11785   EE bb 12385
         2124  +  EE bb 12385   EE bb 12385   FF aa 13416   FF aa 13416   FF aa 13416
         2125  +  FF aa 13416   FF bb 10961   FF bb 10961   FF bb 10961   FF bb 10961
         2126  +  FF bb 10961   FF bb 10961   GG aa 11954   GG aa 11954   GG aa 11954
         2127  +  GG aa 11954   GG bb 11097   GG bb 11097   GG bb 11097   GG bb 11097
         2128  +  HH aa 10634   HH aa 10634   HH aa 10634   HH bb 7440   HH bb 7440
         2129  +  HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   II aa 6390   II aa 6390
         2130  +  II bb 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800   JJ aa 1786
         2131  +  JJ aa 1786   JJ aa 1786   JJ aa 1786   JJ bb {}   JJ bb {}   JJ bb {}
         2132  +  JJ bb {}}
   539   2133   
   540   2134   do_execsql_test 1.18.3 {
   541   2135     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 1 FOLLOWING         AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   542         -} {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}
         2136  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         2137  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         2138  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         2139  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         2140  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         2141  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         2142  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         2143  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         2144  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         2145  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         2146  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         2147  +  JJ bb 73   JJ bb 73   JJ bb 73}
   543   2148   
   544   2149   do_execsql_test 1.18.4 {
   545   2150     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   546         -} {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 {}}
         2151  +} {AA aa 870   AA aa 870   AA aa 870   AA aa 870   AA bb 845   AA bb 845
         2152  +  AA bb 845   AA bb 845   BB aa 959   BB aa 959   BB aa 959   BB aa 959
         2153  +  BB aa 959   BB aa 959   BB bb 959   BB bb 959   BB bb 959   BB bb 959
         2154  +  BB bb 959   BB bb 959   CC aa 959   CC aa 959   CC aa 959   CC aa 959
         2155  +  CC bb 959   CC bb 959   DD aa 959   DD aa 959   DD aa 959   DD bb 938
         2156  +  DD bb 938   DD bb 938   DD bb 938   EE aa 938   EE aa 938   EE bb 979
         2157  +  EE bb 979   EE bb 979   FF aa 979   FF aa 979   FF aa 979   FF aa 979
         2158  +  FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979
         2159  +  GG aa 979   GG aa 979   GG aa 979   GG aa 979   GG bb 979   GG bb 979
         2160  +  GG bb 979   GG bb 979   HH aa 963   HH aa 963   HH aa 963   HH bb 899
         2161  +  HH bb 899   HH bb 899   HH bb 899   HH bb 899   HH bb 899   II aa 899
         2162  +  II aa 899   II bb 899   II bb 899   II bb 899   II bb 899   II bb 899
         2163  +  JJ aa 839   JJ aa 839   JJ aa 839   JJ aa 839   JJ bb {}   JJ bb {}
         2164  +  JJ bb {}   JJ bb {}}
   547   2165   
   548   2166   do_execsql_test 1.18.5 {
   549   2167     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   550         -} {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 {}}
         2168  +} {AA aa 158   AA aa 158   AA aa 158   AA aa 158   AA bb 158   AA bb 158
         2169  +  AA bb 158   AA bb 158   BB aa 158   BB aa 158   BB aa 158   BB aa 158
         2170  +  BB aa 158   BB aa 158   BB bb 113   BB bb 113   BB bb 113   BB bb 113
         2171  +  BB bb 113   BB bb 113   CC aa 113   CC aa 113   CC aa 113   CC aa 113
         2172  +  CC bb 113   CC bb 113   DD aa 102   DD aa 102   DD aa 102   DD bb 102
         2173  +  DD bb 102   DD bb 102   DD bb 102   EE aa 102   EE aa 102   EE bb 102
         2174  +  EE bb 102   EE bb 102   FF aa 102   FF aa 102   FF aa 102   FF aa 102
         2175  +  FF bb 133   FF bb 133   FF bb 133   FF bb 133   FF bb 133   FF bb 133
         2176  +  GG aa 133   GG aa 133   GG aa 133   GG aa 133   GG bb 113   GG bb 113
         2177  +  GG bb 113   GG bb 113   HH aa 113   HH aa 113   HH aa 113   HH bb 113
         2178  +  HH bb 113   HH bb 113   HH bb 113   HH bb 113   HH bb 113   II aa 113
         2179  +  II aa 113   II bb 113   II bb 113   II bb 113   II bb 113   II bb 113
         2180  +  JJ aa 257   JJ aa 257   JJ aa 257   JJ aa 257   JJ bb {}   JJ bb {}
         2181  +  JJ bb {}   JJ bb {}}
   551   2182   
   552   2183   do_execsql_test 1.18.6 {
   553   2184     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;
   554         -} {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 {}}
         2185  +} {AA aa 22701   AA aa 22701   AA aa 22701   AA aa 22701   AA bb 22701
         2186  +  AA bb 22701   AA bb 22701   AA bb 22701   BB aa 19829   BB aa 19829
         2187  +  BB aa 19829   BB aa 19829   BB aa 19829   BB aa 19829   BB bb 19829
         2188  +  BB bb 19829   BB bb 19829   BB bb 19829   BB bb 19829   BB bb 19829
         2189  +  CC aa 22150   CC aa 22150   CC aa 22150   CC aa 22150   CC bb 22150
         2190  +  CC bb 22150   DD aa 21758   DD aa 21758   DD aa 21758   DD bb 21758
         2191  +  DD bb 21758   DD bb 21758   DD bb 21758   EE aa 23019   EE aa 23019
         2192  +  EE bb 23019   EE bb 23019   EE bb 23019   FF aa 17351   FF aa 17351
         2193  +  FF aa 17351   FF aa 17351   FF bb 17351   FF bb 17351   FF bb 17351
         2194  +  FF bb 17351   FF bb 17351   FF bb 17351   GG aa 12883   GG aa 12883
         2195  +  GG aa 12883   GG aa 12883   GG bb 12883   GG bb 12883   GG bb 12883
         2196  +  GG bb 12883   HH aa 7440   HH aa 7440   HH aa 7440   HH bb 7440
         2197  +  HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   II aa 3800
         2198  +  II aa 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800
         2199  +  JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}   JJ bb {}   JJ bb {}
         2200  +  JJ bb {}}
   555   2201   
   556   2202   do_execsql_test 1.18.7 {
   557   2203     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;
   558         -} {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 {}}
         2204  +} {AA aa 12840   AA aa 12840   AA aa 12840   AA aa 12840   AA bb 11787
         2205  +  AA bb 11787   AA bb 11787   AA bb 11787   BB aa 11621   BB aa 11621
         2206  +  BB aa 11621   BB aa 11621   BB aa 11621   BB aa 11621   BB bb 8044
         2207  +  BB bb 8044   BB bb 8044   BB bb 8044   BB bb 8044   BB bb 8044   CC aa 7739
         2208  +  CC aa 7739   CC aa 7739   CC aa 7739   CC bb 8734   CC bb 8734
         2209  +  DD aa 10914   DD aa 10914   DD aa 10914   DD bb 9804   DD bb 9804
         2210  +  DD bb 9804   DD bb 9804   EE aa 11785   EE aa 11785   EE bb 12385
         2211  +  EE bb 12385   EE bb 12385   FF aa 13416   FF aa 13416   FF aa 13416
         2212  +  FF aa 13416   FF bb 10961   FF bb 10961   FF bb 10961   FF bb 10961
         2213  +  FF bb 10961   FF bb 10961   GG aa 11954   GG aa 11954   GG aa 11954
         2214  +  GG aa 11954   GG bb 11097   GG bb 11097   GG bb 11097   GG bb 11097
         2215  +  HH aa 10634   HH aa 10634   HH aa 10634   HH bb 7440   HH bb 7440
         2216  +  HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   II aa 6390   II aa 6390
         2217  +  II bb 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800   JJ aa 1786
         2218  +  JJ aa 1786   JJ aa 1786   JJ aa 1786   JJ bb {}   JJ bb {}   JJ bb {}
         2219  +  JJ bb {}}
   559   2220   
   560   2221   do_execsql_test 1.19.1 {
   561   2222     SELECT a, b, sum(c) OVER (ORDER BY a  GROUPS BETWEEN 1 FOLLOWING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   562         -} {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 {}}
         2223  +} {AA aa 40052   AA aa 40052   AA aa 40052   AA aa 40052   AA bb 40052
         2224  +  AA bb 40052   AA bb 40052   AA bb 40052   BB aa 32712   BB aa 32712
         2225  +  BB aa 32712   BB aa 32712   BB aa 32712   BB aa 32712   BB bb 32712
         2226  +  BB bb 32712   BB bb 32712   BB bb 32712   BB bb 32712   BB bb 32712
         2227  +  CC aa 29590   CC aa 29590   CC aa 29590   CC aa 29590   CC bb 29590
         2228  +  CC bb 29590   DD aa 25558   DD aa 25558   DD aa 25558   DD bb 25558
         2229  +  DD bb 25558   DD bb 25558   DD bb 25558   EE aa 23019   EE aa 23019
         2230  +  EE bb 23019   EE bb 23019   EE bb 23019   FF aa 17351   FF aa 17351
         2231  +  FF aa 17351   FF aa 17351   FF bb 17351   FF bb 17351   FF bb 17351
         2232  +  FF bb 17351   FF bb 17351   FF bb 17351   GG aa 12883   GG aa 12883
         2233  +  GG aa 12883   GG aa 12883   GG bb 12883   GG bb 12883   GG bb 12883
         2234  +  GG bb 12883   HH aa 7440   HH aa 7440   HH aa 7440   HH bb 7440
         2235  +  HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   II aa 3800
         2236  +  II aa 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800
         2237  +  JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}   JJ bb {}   JJ bb {}
         2238  +  JJ bb {}}
   563   2239   
   564   2240   do_execsql_test 1.19.2 {
   565   2241     SELECT a, b, sum(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   566         -} {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 {}}
         2242  +} {AA aa 42430   AA aa 42430   AA aa 42430   AA aa 42430   AA bb 40052
         2243  +  AA bb 40052   AA bb 40052   AA bb 40052   BB aa 37179   BB aa 37179
         2244  +  BB aa 37179   BB aa 37179   BB aa 37179   BB aa 37179   BB bb 32712
         2245  +  BB bb 32712   BB bb 32712   BB bb 32712   BB bb 32712   BB bb 32712
         2246  +  CC aa 30758   CC aa 30758   CC aa 30758   CC aa 30758   CC bb 29590
         2247  +  CC bb 29590   DD aa 28265   DD aa 28265   DD aa 28265   DD bb 25558
         2248  +  DD bb 25558   DD bb 25558   DD bb 25558   EE aa 24668   EE aa 24668
         2249  +  EE bb 23019   EE bb 23019   EE bb 23019   FF aa 20856   FF aa 20856
         2250  +  FF aa 20856   FF aa 20856   FF bb 17351   FF bb 17351   FF bb 17351
         2251  +  FF bb 17351   FF bb 17351   FF bb 17351   GG aa 15754   GG aa 15754
         2252  +  GG aa 15754   GG aa 15754   GG bb 12883   GG bb 12883   GG bb 12883
         2253  +  GG bb 12883   HH aa 10634   HH aa 10634   HH aa 10634   HH bb 7440
         2254  +  HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   II aa 6390
         2255  +  II aa 6390   II bb 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800
         2256  +  JJ aa 1786   JJ aa 1786   JJ aa 1786   JJ aa 1786   JJ bb {}   JJ bb {}
         2257  +  JJ bb {}   JJ bb {}}
   567   2258   
   568   2259   do_execsql_test 1.19.3 {
   569   2260     SELECT a, b, rank() OVER (ORDER BY a  GROUPS BETWEEN 1 FOLLOWING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   570         -} {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}
         2261  +} {AA aa 1   AA aa 1   AA aa 1   AA aa 1   AA bb 1   AA bb 1   AA bb 1
         2262  +  AA bb 1   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9   BB aa 9
         2263  +  BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   BB bb 9   CC aa 21
         2264  +  CC aa 21   CC aa 21   CC aa 21   CC bb 21   CC bb 21   DD aa 27   DD aa 27
         2265  +  DD aa 27   DD bb 27   DD bb 27   DD bb 27   DD bb 27   EE aa 34   EE aa 34
         2266  +  EE bb 34   EE bb 34   EE bb 34   FF aa 39   FF aa 39   FF aa 39   FF aa 39
         2267  +  FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   FF bb 39   GG aa 49
         2268  +  GG aa 49   GG aa 49   GG aa 49   GG bb 49   GG bb 49   GG bb 49   GG bb 49
         2269  +  HH aa 57   HH aa 57   HH aa 57   HH bb 57   HH bb 57   HH bb 57   HH bb 57
         2270  +  HH bb 57   HH bb 57   II aa 66   II aa 66   II bb 66   II bb 66   II bb 66
         2271  +  II bb 66   II bb 66   JJ aa 73   JJ aa 73   JJ aa 73   JJ aa 73   JJ bb 73
         2272  +  JJ bb 73   JJ bb 73   JJ bb 73}
   571   2273   
   572   2274   do_execsql_test 1.19.4 {
   573   2275     SELECT a, b, max(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   574         -} {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 {}}
         2276  +} {AA aa 979   AA aa 979   AA aa 979   AA aa 979   AA bb 979   AA bb 979
         2277  +  AA bb 979   AA bb 979   BB aa 979   BB aa 979   BB aa 979   BB aa 979
         2278  +  BB aa 979   BB aa 979   BB bb 979   BB bb 979   BB bb 979   BB bb 979
         2279  +  BB bb 979   BB bb 979   CC aa 979   CC aa 979   CC aa 979   CC aa 979
         2280  +  CC bb 979   CC bb 979   DD aa 979   DD aa 979   DD aa 979   DD bb 979
         2281  +  DD bb 979   DD bb 979   DD bb 979   EE aa 979   EE aa 979   EE bb 979
         2282  +  EE bb 979   EE bb 979   FF aa 979   FF aa 979   FF aa 979   FF aa 979
         2283  +  FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979   FF bb 979
         2284  +  GG aa 979   GG aa 979   GG aa 979   GG aa 979   GG bb 979   GG bb 979
         2285  +  GG bb 979   GG bb 979   HH aa 963   HH aa 963   HH aa 963   HH bb 899
         2286  +  HH bb 899   HH bb 899   HH bb 899   HH bb 899   HH bb 899   II aa 899
         2287  +  II aa 899   II bb 899   II bb 899   II bb 899   II bb 899   II bb 899
         2288  +  JJ aa 839   JJ aa 839   JJ aa 839   JJ aa 839   JJ bb {}   JJ bb {}
         2289  +  JJ bb {}   JJ bb {}}
   575   2290   
   576   2291   do_execsql_test 1.19.5 {
   577   2292     SELECT a, b, min(c) OVER (ORDER BY a,b  GROUPS BETWEEN 1 FOLLOWING         AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
   578         -} {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 {}}
         2293  +} {AA aa 102   AA aa 102   AA aa 102   AA aa 102   AA bb 102   AA bb 102
         2294  +  AA bb 102   AA bb 102   BB aa 102   BB aa 102   BB aa 102   BB aa 102
         2295  +  BB aa 102   BB aa 102   BB bb 102   BB bb 102   BB bb 102   BB bb 102
         2296  +  BB bb 102   BB bb 102   CC aa 102   CC aa 102   CC aa 102   CC aa 102
         2297  +  CC bb 102   CC bb 102   DD aa 102   DD aa 102   DD aa 102   DD bb 102
         2298  +  DD bb 102   DD bb 102   DD bb 102   EE aa 102   EE aa 102   EE bb 102
         2299  +  EE bb 102   EE bb 102   FF aa 102   FF aa 102   FF aa 102   FF aa 102
         2300  +  FF bb 113   FF bb 113   FF bb 113   FF bb 113   FF bb 113   FF bb 113
         2301  +  GG aa 113   GG aa 113   GG aa 113   GG aa 113   GG bb 113   GG bb 113
         2302  +  GG bb 113   GG bb 113   HH aa 113   HH aa 113   HH aa 113   HH bb 113
         2303  +  HH bb 113   HH bb 113   HH bb 113   HH bb 113   HH bb 113   II aa 113
         2304  +  II aa 113   II bb 113   II bb 113   II bb 113   II bb 113   II bb 113
         2305  +  JJ aa 257   JJ aa 257   JJ aa 257   JJ aa 257   JJ bb {}   JJ bb {}
         2306  +  JJ bb {}   JJ bb {}}
   579   2307   
   580   2308   do_execsql_test 1.19.6 {
   581   2309     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;
   582         -} {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 {}}
         2310  +} {AA aa 40052   AA aa 40052   AA aa 40052   AA aa 40052   AA bb 40052
         2311  +  AA bb 40052   AA bb 40052   AA bb 40052   BB aa 32712   BB aa 32712
         2312  +  BB aa 32712   BB aa 32712   BB aa 32712   BB aa 32712   BB bb 32712
         2313  +  BB bb 32712   BB bb 32712   BB bb 32712   BB bb 32712   BB bb 32712
         2314  +  CC aa 29590   CC aa 29590   CC aa 29590   CC aa 29590   CC bb 29590
         2315  +  CC bb 29590   DD aa 25558   DD aa 25558   DD aa 25558   DD bb 25558
         2316  +  DD bb 25558   DD bb 25558   DD bb 25558   EE aa 23019   EE aa 23019
         2317  +  EE bb 23019   EE bb 23019   EE bb 23019   FF aa 17351   FF aa 17351
         2318  +  FF aa 17351   FF aa 17351   FF bb 17351   FF bb 17351   FF bb 17351
         2319  +  FF bb 17351   FF bb 17351   FF bb 17351   GG aa 12883   GG aa 12883
         2320  +  GG aa 12883   GG aa 12883   GG bb 12883   GG bb 12883   GG bb 12883
         2321  +  GG bb 12883   HH aa 7440   HH aa 7440   HH aa 7440   HH bb 7440
         2322  +  HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   II aa 3800
         2323  +  II aa 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800
         2324  +  JJ aa {}   JJ aa {}   JJ aa {}   JJ aa {}   JJ bb {}   JJ bb {}   JJ bb {}
         2325  +  JJ bb {}}
   583   2326   
   584   2327   do_execsql_test 1.19.7 {
   585   2328     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;
   586         -} {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 {}}
         2329  +} {AA aa 42430   AA aa 42430   AA aa 42430   AA aa 42430   AA bb 40052
         2330  +  AA bb 40052   AA bb 40052   AA bb 40052   BB aa 37179   BB aa 37179
         2331  +  BB aa 37179   BB aa 37179   BB aa 37179   BB aa 37179   BB bb 32712
         2332  +  BB bb 32712   BB bb 32712   BB bb 32712   BB bb 32712   BB bb 32712
         2333  +  CC aa 30758   CC aa 30758   CC aa 30758   CC aa 30758   CC bb 29590
         2334  +  CC bb 29590   DD aa 28265   DD aa 28265   DD aa 28265   DD bb 25558
         2335  +  DD bb 25558   DD bb 25558   DD bb 25558   EE aa 24668   EE aa 24668
         2336  +  EE bb 23019   EE bb 23019   EE bb 23019   FF aa 20856   FF aa 20856
         2337  +  FF aa 20856   FF aa 20856   FF bb 17351   FF bb 17351   FF bb 17351
         2338  +  FF bb 17351   FF bb 17351   FF bb 17351   GG aa 15754   GG aa 15754
         2339  +  GG aa 15754   GG aa 15754   GG bb 12883   GG bb 12883   GG bb 12883
         2340  +  GG bb 12883   HH aa 10634   HH aa 10634   HH aa 10634   HH bb 7440
         2341  +  HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   HH bb 7440   II aa 6390
         2342  +  II aa 6390   II bb 3800   II bb 3800   II bb 3800   II bb 3800   II bb 3800
         2343  +  JJ aa 1786   JJ aa 1786   JJ aa 1786   JJ aa 1786   JJ bb {}   JJ bb {}
         2344  +  JJ bb {}   JJ bb {}}
   587   2345   
   588   2346   do_execsql_test 2.1.1 {
   589   2347     SELECT row_number() OVER win 
   590   2348       FROM t3
   591   2349       WINDOW win AS (
   592   2350         ORDER BY c, b, a
   593   2351         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE NO OTHERS 
   594   2352       )
   595         -} {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}
         2353  +} {1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17
         2354  +  18   19   20   21   22   23   24   25   26   27   28   29   30   31   32
         2355  +  33   34   35   36   37   38   39   40   41   42   43   44   45   46   47
         2356  +  48   49   50   51   52   53   54   55   56   57   58   59   60   61   62
         2357  +  63   64   65   66   67   68   69   70   71   72   73   74   75   76   77
         2358  +  78   79   80}
   596   2359   
   597   2360   do_execsql_test 2.1.2 {
   598   2361     SELECT nth_value(c, 14) OVER win 
   599   2362       FROM t3
   600   2363       WINDOW win AS (
   601   2364         ORDER BY c, b, a
   602   2365         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE NO OTHERS 
   603   2366       )
   604         -} {247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247}
         2367  +} {247   247   247   247   247   247   247   247   247   247   247   247   247
         2368  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2369  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2370  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2371  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2372  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2373  +  247   247}
         2374  +
         2375  +do_execsql_test 2.1.3 {
         2376  +  SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
         2377  +    WINDOW win AS (
         2378  +      ORDER BY c, b, a
         2379  +      ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW  EXCLUDE NO OTHERS 
         2380  +    ) ORDER BY a, b, c;
         2381  +} {102 223 1358   102 239 2293   102 911 38097   102 934 39960   102 309 4159
         2382  +  102 572 10643   102 627 13069   102 870 35417   102 247 2540   102 393 6608
         2383  +  102 399 7405   102 412 7817   102 660 16277   102 762 24077   102 633 14331
         2384  +  102 705 19673   102 711 20384   102 786 27176   102 792 28758
         2385  +  102 840 32858   102 158 767   102 430 8668   102 607 11824   102 759 23315
         2386  +  102 346 5506   102 822 31179   102 224 1582   102 256 3298   102 845 34547
         2387  +  102 238 2054   102 716 21100   102 794 29552   102 959 42795   102 113 215
         2388  +  102 777 26390   102 252 3042   102 629 13698   102 768 25613   102 208 1135
         2389  +  102 618 12442   102 667 16944   102 670 17614   102 102 102   102 295 3850
         2390  +  102 574 11217   102 726 21826   102 870 36287   102 938 40898   102 148 609
         2391  +  102 335 4824   102 480 9591   102 634 14965   102 160 927   102 844 33702
         2392  +  102 929 39026   102 938 41836   102 480 10071   102 790 27966
         2393  +  102 979 44737   102 133 461   102 330 4489   102 355 6215   102 683 18968
         2394  +  102 730 22556   102 963 43758   102 398 7006   102 652 15617   102 250 2790
         2395  +  102 421 8238   102 443 9111   102 671 18285   102 805 30357   102 113 328
         2396  +  102 234 1816   102 768 24845   102 899 37186   102 257 3555   102 336 5160
         2397  +  102 354 5860   102 839 32018}
   605   2398   
   606   2399   do_execsql_test 2.2.1 {
   607   2400     SELECT row_number() OVER win 
   608   2401       FROM t3
   609   2402       WINDOW win AS (
   610   2403         ORDER BY c, b, a
   611   2404         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE CURRENT ROW 
   612   2405       )
   613         -} {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}
         2406  +} {1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17
         2407  +  18   19   20   21   22   23   24   25   26   27   28   29   30   31   32
         2408  +  33   34   35   36   37   38   39   40   41   42   43   44   45   46   47
         2409  +  48   49   50   51   52   53   54   55   56   57   58   59   60   61   62
         2410  +  63   64   65   66   67   68   69   70   71   72   73   74   75   76   77
         2411  +  78   79   80}
   614   2412   
   615   2413   do_execsql_test 2.2.2 {
   616   2414     SELECT nth_value(c, 14) OVER win 
   617   2415       FROM t3
   618   2416       WINDOW win AS (
   619   2417         ORDER BY c, b, a
   620   2418         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE CURRENT ROW 
   621   2419       )
   622         -} {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}
         2420  +} {250   250   250   250   250   250   250   250   250   250   250   250   250
         2421  +  250   247   247   247   247   247   247   247   247   247   247   247   247
         2422  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2423  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2424  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2425  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2426  +  247   247}
         2427  +
         2428  +do_execsql_test 2.2.3 {
         2429  +  SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
         2430  +    WINDOW win AS (
         2431  +      ORDER BY c, b, a
         2432  +      ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW  EXCLUDE CURRENT ROW 
         2433  +    ) ORDER BY a, b, c;
         2434  +} {102 208 1135   102 238 2054   102 899 37186   102 929 39026   102 295 3850
         2435  +  102 480 10071   102 618 12442   102 845 34547   102 239 2293   102 355 6215
         2436  +  102 398 7006   102 399 7405   102 652 15617   102 759 23315   102 629 13698
         2437  +  102 683 18968   102 705 19673   102 777 26390   102 790 27966
         2438  +  102 839 32018   102 148 609   102 421 8238   102 574 11217   102 730 22556
         2439  +  102 336 5160   102 805 30357   102 223 1358   102 252 3042   102 844 33702
         2440  +  102 234 1816   102 711 20384   102 792 28758   102 938 41836   102 102 102
         2441  +  102 768 25613   102 250 2790   102 627 13069   102 768 24845   102 160 927
         2442  +  102 607 11824   102 660 16277   102 667 16944   {} {} {}   102 257 3555
         2443  +  102 572 10643   102 716 21100   102 870 35417   102 934 39960   102 133 461
         2444  +  102 330 4489   102 443 9111   102 633 14331   102 158 767   102 840 32858
         2445  +  102 911 38097   102 938 40898   102 480 9591   102 786 27176
         2446  +  102 963 43758   102 113 328   102 309 4159   102 354 5860   102 671 18285
         2447  +  102 726 21826   102 959 42795   102 393 6608   102 634 14965   102 247 2540
         2448  +  102 412 7817   102 430 8668   102 670 17614   102 794 29552   102 113 215
         2449  +  102 224 1582   102 762 24077   102 870 36287   102 256 3298   102 335 4824
         2450  +  102 346 5506   102 822 31179}
   623   2451   
   624   2452   do_execsql_test 2.3.1 {
   625   2453     SELECT row_number() OVER win 
   626   2454       FROM t3
   627   2455       WINDOW win AS (
   628   2456         ORDER BY c, b, a
   629   2457         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE GROUP 
   630   2458       )
   631         -} {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}
         2459  +} {1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17
         2460  +  18   19   20   21   22   23   24   25   26   27   28   29   30   31   32
         2461  +  33   34   35   36   37   38   39   40   41   42   43   44   45   46   47
         2462  +  48   49   50   51   52   53   54   55   56   57   58   59   60   61   62
         2463  +  63   64   65   66   67   68   69   70   71   72   73   74   75   76   77
         2464  +  78   79   80}
   632   2465   
   633   2466   do_execsql_test 2.3.2 {
   634   2467     SELECT nth_value(c, 14) OVER win 
   635   2468       FROM t3
   636   2469       WINDOW win AS (
   637   2470         ORDER BY c, b, a
   638   2471         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE GROUP 
   639   2472       )
   640         -} {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}
         2473  +} {250   250   250   250   250   250   250   250   250   250   250   250   250
         2474  +  250   247   247   247   247   247   247   247   247   247   247   247   247
         2475  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2476  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2477  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2478  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2479  +  247   247}
         2480  +
         2481  +do_execsql_test 2.3.3 {
         2482  +  SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
         2483  +    WINDOW win AS (
         2484  +      ORDER BY c, b, a
         2485  +      ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW  EXCLUDE GROUP 
         2486  +    ) ORDER BY a, b, c;
         2487  +} {102 208 1135   102 238 2054   102 899 37186   102 929 39026   102 295 3850
         2488  +  102 480 10071   102 618 12442   102 845 34547   102 239 2293   102 355 6215
         2489  +  102 398 7006   102 399 7405   102 652 15617   102 759 23315   102 629 13698
         2490  +  102 683 18968   102 705 19673   102 777 26390   102 790 27966
         2491  +  102 839 32018   102 148 609   102 421 8238   102 574 11217   102 730 22556
         2492  +  102 336 5160   102 805 30357   102 223 1358   102 252 3042   102 844 33702
         2493  +  102 234 1816   102 711 20384   102 792 28758   102 938 41836   102 102 102
         2494  +  102 768 25613   102 250 2790   102 627 13069   102 768 24845   102 160 927
         2495  +  102 607 11824   102 660 16277   102 667 16944   {} {} {}   102 257 3555
         2496  +  102 572 10643   102 716 21100   102 870 35417   102 934 39960   102 133 461
         2497  +  102 330 4489   102 443 9111   102 633 14331   102 158 767   102 840 32858
         2498  +  102 911 38097   102 938 40898   102 480 9591   102 786 27176
         2499  +  102 963 43758   102 113 328   102 309 4159   102 354 5860   102 671 18285
         2500  +  102 726 21826   102 959 42795   102 393 6608   102 634 14965   102 247 2540
         2501  +  102 412 7817   102 430 8668   102 670 17614   102 794 29552   102 113 215
         2502  +  102 224 1582   102 762 24077   102 870 36287   102 256 3298   102 335 4824
         2503  +  102 346 5506   102 822 31179}
   641   2504   
   642   2505   do_execsql_test 2.4.1 {
   643   2506     SELECT row_number() OVER win 
   644   2507       FROM t3
   645   2508       WINDOW win AS (
   646   2509         ORDER BY c, b, a
   647   2510         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE TIES 
   648   2511       )
   649         -} {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}
         2512  +} {1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17
         2513  +  18   19   20   21   22   23   24   25   26   27   28   29   30   31   32
         2514  +  33   34   35   36   37   38   39   40   41   42   43   44   45   46   47
         2515  +  48   49   50   51   52   53   54   55   56   57   58   59   60   61   62
         2516  +  63   64   65   66   67   68   69   70   71   72   73   74   75   76   77
         2517  +  78   79   80}
   650   2518   
   651   2519   do_execsql_test 2.4.2 {
   652   2520     SELECT nth_value(c, 14) OVER win 
   653   2521       FROM t3
   654   2522       WINDOW win AS (
   655   2523         ORDER BY c, b, a
   656   2524         ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE TIES 
   657   2525       )
   658         -} {247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247   247}
         2526  +} {247   247   247   247   247   247   247   247   247   247   247   247   247
         2527  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2528  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2529  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2530  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2531  +  247   247   247   247   247   247   247   247   247   247   247   247   247
         2532  +  247   247}
         2533  +
         2534  +do_execsql_test 2.4.3 {
         2535  +  SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
         2536  +    WINDOW win AS (
         2537  +      ORDER BY c, b, a
         2538  +      ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW  EXCLUDE TIES 
         2539  +    ) ORDER BY a, b, c;
         2540  +} {102 223 1358   102 239 2293   102 911 38097   102 934 39960   102 309 4159
         2541  +  102 572 10643   102 627 13069   102 870 35417   102 247 2540   102 393 6608
         2542  +  102 399 7405   102 412 7817   102 660 16277   102 762 24077   102 633 14331
         2543  +  102 705 19673   102 711 20384   102 786 27176   102 792 28758
         2544  +  102 840 32858   102 158 767   102 430 8668   102 607 11824   102 759 23315
         2545  +  102 346 5506   102 822 31179   102 224 1582   102 256 3298   102 845 34547
         2546  +  102 238 2054   102 716 21100   102 794 29552   102 959 42795   102 113 215
         2547  +  102 777 26390   102 252 3042   102 629 13698   102 768 25613   102 208 1135
         2548  +  102 618 12442   102 667 16944   102 670 17614   102 102 102   102 295 3850
         2549  +  102 574 11217   102 726 21826   102 870 36287   102 938 40898   102 148 609
         2550  +  102 335 4824   102 480 9591   102 634 14965   102 160 927   102 844 33702
         2551  +  102 929 39026   102 938 41836   102 480 10071   102 790 27966
         2552  +  102 979 44737   102 133 461   102 330 4489   102 355 6215   102 683 18968
         2553  +  102 730 22556   102 963 43758   102 398 7006   102 652 15617   102 250 2790
         2554  +  102 421 8238   102 443 9111   102 671 18285   102 805 30357   102 113 328
         2555  +  102 234 1816   102 768 24845   102 899 37186   102 257 3555   102 336 5160
         2556  +  102 354 5860   102 839 32018}
   659   2557   
   660   2558   #==========================================================================
   661   2559   
   662   2560   do_execsql_test 3.0 {
   663   2561     DROP TABLE IF EXISTS t1;
   664   2562     CREATE TABLE t1(a REAL, b INTEGER);
   665   2563     INSERT INTO t1 VALUES
................................................................................
   710   2608   do_execsql_test 3.11 {
   711   2609     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 )
   712   2610   } {30 {}   22 90   20 90   15 170   13 210   13 210   10 210   5 292}
   713   2611   
   714   2612   do_execsql_test 3.12 {
   715   2613     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 )
   716   2614   } {30 232   22 112   20 112   15 30   13 30   13 30   10 10   5 {}}
         2615  +
         2616  +#==========================================================================
         2617  +
         2618  +do_execsql_test 4.0 {
         2619  +  DROP TABLE IF EXISTS t1;
         2620  +  CREATE TABLE t1(a INTEGER, b INTEGER);
         2621  +  INSERT INTO t1 VALUES
         2622  +    (NULL, 1), (NULL, 2), (NULL, 3), (10, 4), (10, 5);
         2623  +} {}
         2624  +
         2625  +do_execsql_test 4.1 {
         2626  +  SELECT sum(b) OVER (
         2627  +    ORDER BY a RANGE BETWEEN 5 PRECEDING AND 10 FOLLOWING
         2628  +  ) FROM t1 ORDER BY 1;
         2629  +} {6   6   6   9   9}
   717   2630   
   718   2631   finish_test