/ Check-in [3f093f60]
Login

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

Overview
Comment:Add implementation of window function ntile().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | exp-window-functions
Files: files | file ages | folders
SHA3-256: 3f093f608c6cc193aac77e7eafa8006c27a7776682d9d7b6e743710dff41ae42
User & Date: dan 2018-06-04 18:55:11
Context
2018-06-05
16:16
Add implementation of last_value() window function. check-in: 2493ce1a user: dan tags: exp-window-functions
2018-06-04
18:55
Add implementation of window function ntile(). check-in: 3f093f60 user: dan tags: exp-window-functions
08:28
Merge latest trunk changes into this branch. check-in: 83d6416a user: dan tags: exp-window-functions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/window.c.

   175    175     struct CallCount *p;
   176    176     p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p));
   177    177     if( p ){
   178    178       double r = (double)(p->nStep) / (double)(p->nTotal);
   179    179       sqlite3_result_double(pCtx, r);
   180    180     }
   181    181   }
          182  +
          183  +struct NtileCtx {
          184  +  i64 nTotal;                     /* Total rows in partition */
          185  +  i64 nParam;                     /* Parameter passed to ntile(N) */
          186  +  i64 iRow;                       /* Current row */
          187  +};
          188  +
          189  +/*
          190  +** Implementation of ntile(). This assumes that the window frame has
          191  +** been coerced to:
          192  +**
          193  +**   ROWS UNBOUNDED PRECEDING AND CURRENT ROW
          194  +**
          195  +*/
          196  +static void ntileStepFunc(
          197  +  sqlite3_context *pCtx, 
          198  +  int nArg,
          199  +  sqlite3_value **apArg
          200  +){
          201  +  struct NtileCtx *p;
          202  +  assert( nArg==2 );
          203  +  p = (struct NtileCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p));
          204  +  if( p ){
          205  +    if( p->nTotal==0 ){
          206  +      p->nParam = sqlite3_value_int64(apArg[0]);
          207  +      p->nTotal = sqlite3_value_int64(apArg[1]);
          208  +      if( p->nParam<=0 ){
          209  +        sqlite3_result_error(
          210  +            pCtx, "argument of ntile must be a positive integer", -1
          211  +        );
          212  +      }
          213  +    }
          214  +    p->iRow++;
          215  +  }
          216  +}
          217  +static void ntileInverseFunc(
          218  +  sqlite3_context *pCtx, 
          219  +  int nArg,
          220  +  sqlite3_value **apArg
          221  +){
          222  +}
          223  +static void ntileValueFunc(sqlite3_context *pCtx){
          224  +  struct NtileCtx *p;
          225  +  p = (struct NtileCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p));
          226  +  if( p && p->nParam>0 ){
          227  +    int nSize = (p->nTotal / p->nParam);
          228  +    if( nSize==0 ){
          229  +      sqlite3_result_int64(pCtx, p->iRow);
          230  +    }else{
          231  +      i64 nLarge = p->nTotal - p->nParam*nSize;
          232  +      i64 iSmall = nLarge*(nSize+1);
          233  +      i64 iRow = p->iRow-1;
          234  +
          235  +      assert( (nLarge*(nSize+1) + (p->nParam-nLarge)*nSize)==p->nTotal );
          236  +
          237  +      if( iRow<iSmall ){
          238  +        sqlite3_result_int64(pCtx, 1 + iRow/(nSize+1));
          239  +      }else{
          240  +        sqlite3_result_int64(pCtx, 1 + nLarge + (iRow-iSmall)/nSize);
          241  +      }
          242  +    }
          243  +  }
          244  +}
   182    245   
   183    246   static void nth_valueStepFunc(
   184    247     sqlite3_context *pCtx, 
   185    248     int nArg,
   186    249     sqlite3_value **apArg
   187    250   ){
   188    251   }
................................................................................
   207    270   void sqlite3WindowFunctions(void){
   208    271     static FuncDef aWindowFuncs[] = {
   209    272       WINDOWFUNC(row_number, 0, 0),
   210    273       WINDOWFUNC(dense_rank, 0, 0),
   211    274       WINDOWFUNC(rank, 0, 0),
   212    275       WINDOWFUNC(percent_rank, 0, SQLITE_FUNC_WINDOW_SIZE),
   213    276       WINDOWFUNC(cume_dist, 0, SQLITE_FUNC_WINDOW_SIZE),
          277  +    WINDOWFUNC(ntile, 1, SQLITE_FUNC_WINDOW_SIZE),
   214    278       WINDOWFUNC(nth_value, 2, 0),
   215    279     };
   216    280     sqlite3InsertBuiltinFuncs(aWindowFuncs, ArraySize(aWindowFuncs));
   217    281   }
   218    282   
   219    283   void sqlite3WindowUpdate(Parse *pParse, Window *pWin, FuncDef *pFunc){
   220    284     if( pFunc->funcFlags & SQLITE_FUNC_WINDOW ){
   221    285       sqlite3 *db = pParse->db;
   222         -    if( pFunc->xSFunc==row_numberStepFunc ){
          286  +    if( pFunc->xSFunc==row_numberStepFunc || pFunc->xSFunc==ntileStepFunc ){
   223    287         sqlite3ExprDelete(db, pWin->pStart);
   224    288         sqlite3ExprDelete(db, pWin->pEnd);
   225    289         pWin->pStart = pWin->pEnd = 0;
   226    290         pWin->eType = TK_ROWS;
   227    291         pWin->eStart = TK_UNBOUNDED;
   228    292         pWin->eEnd = TK_CURRENT;
   229    293       }
................................................................................
   557    621     Vdbe *v = sqlite3GetVdbe(pParse);
   558    622     Window *pWin;
   559    623     for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
   560    624       int flags = pWin->pFunc->funcFlags;
   561    625       int regArg;
   562    626       int nArg = pWin->nArg;
   563    627   
   564         -    if( flags & SQLITE_FUNC_WINDOW_SIZE ){
   565         -      regArg = regPartSize;
   566         -      nArg++;
   567         -    }else if( csr>=0 ){
          628  +    if( csr>=0 ){
   568    629         int i;
   569    630         for(i=0; i<pWin->nArg; i++){
   570    631           sqlite3VdbeAddOp3(v, OP_Column, csr, pWin->iArgCol+i, reg+i);
   571    632         }
   572    633         regArg = reg;
          634  +      if( flags & SQLITE_FUNC_WINDOW_SIZE ){
          635  +        if( nArg==0 ){
          636  +          regArg = regPartSize;
          637  +        }else{
          638  +          sqlite3VdbeAddOp2(v, OP_SCopy, regPartSize, reg+nArg);
          639  +        }
          640  +        nArg++;
          641  +      }
   573    642       }else{
          643  +      assert( !(flags & SQLITE_FUNC_WINDOW_SIZE) );
   574    644         regArg = reg + pWin->iArgCol;
   575    645       }
   576    646   
   577    647       if( pWin->csrApp ){
   578    648         if( bInverse==0 ){
   579    649           sqlite3VdbeAddOp2(v, OP_AddImm, pWin->regApp+1, 1);
   580    650           sqlite3VdbeAddOp2(v, OP_SCopy, regArg, pWin->regApp);
................................................................................
   898    968       sqlite3VdbeAddOp3(v, OP_Subtract, regStart, regEnd, regEnd);
   899    969     }
   900    970   
   901    971     /* Initialize the accumulator register for each window function to NULL */
   902    972     nArg = 0;
   903    973     for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
   904    974       sqlite3VdbeAddOp2(v, OP_Null, 0, pWin->regAccum);
   905         -    nArg = MAX(nArg, pWin->nArg);
          975  +    nArg = MAX(nArg, pWin->nArg+1);
   906    976     }
   907    977     regArg = pParse->nMem+1;
   908    978     pParse->nMem += nArg;
   909    979   
   910    980     sqlite3VdbeAddOp2(v, OP_Rewind, pMWin->iEphCsr, lblFlushDone);
   911    981     sqlite3VdbeAddOp2(v, OP_Rewind, csrStart, lblFlushDone);
   912    982     sqlite3VdbeChangeP5(v, 1);

Changes to test/window1.test.

   176    176     5 2 6.5
   177    177     4 3 6.5.4
   178    178     3 4 6.5.4.3
   179    179     2 5 6.5.4.3.2
   180    180     1 6 6.5.4.3.2.1
   181    181     0 7 6.5.4.3.2.1.0
   182    182   }
          183  +
          184  +do_catchsql_test 5.1 {
          185  +  SELECT ntile(0) OVER (ORDER BY a) FROM t2;
          186  +} {1 {argument of ntile must be a positive integer}}
          187  +do_catchsql_test 5.2 {
          188  +  SELECT ntile(-1) OVER (ORDER BY a) FROM t2;
          189  +} {1 {argument of ntile must be a positive integer}}
          190  +do_catchsql_test 5.3 {
          191  +  SELECT ntile('zbc') OVER (ORDER BY a) FROM t2;
          192  +} {1 {argument of ntile must be a positive integer}}
          193  +do_execsql_test 5.4 {
          194  +  CREATE TABLE t4(a, b);
          195  +  SELECT ntile(1) OVER (ORDER BY a) FROM t4;
          196  +} {}
   183    197   
   184    198   
   185    199   finish_test

Changes to test/window3.tcl.

   163    163     execsql_float_test 1.$tn.8.5 "
   164    164       SELECT cume_dist() OVER ( ORDER BY b%10 $window ) FROM t2
   165    165     "
   166    166     execsql_float_test 1.$tn.8.6 "
   167    167       SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 $window ) FROM t2
   168    168     "
   169    169   
   170         -}
          170  +  execsql_float_test 1.$tn.8.1 "
          171  +    SELECT ntile(100) OVER ( ORDER BY a $window ) FROM t2
          172  +  "
          173  +  execsql_float_test 1.$tn.8.2 "
          174  +    SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a $window ) FROM t2
          175  +  "
          176  +  execsql_float_test 1.$tn.8.3 "
          177  +    SELECT ntile(102) OVER ( ORDER BY b,a $window ) FROM t2
          178  +  "
          179  +  execsql_float_test 1.$tn.8.4 "
          180  +    SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a $window ) FROM t2
          181  +  "
          182  +  execsql_float_test 1.$tn.8.5 "
          183  +    SELECT ntile(104) OVER ( ORDER BY b%10,a $window ) FROM t2
          184  +  "
          185  +  execsql_float_test 1.$tn.8.6 "
          186  +    SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 $window) FROM t2
          187  +  "
   171    188   
          189  +}
   172    190   
   173    191   finish_test
   174    192   

Changes to test/window3.test.

   175    175       lappend myres [format %.2f [set r]]
   176    176     }
   177    177     set myres
   178    178   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
   179    179   
   180    180   do_test 1.1.8.1 {
   181    181     set myres {}
   182         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
   183         -    lappend myres [format %.2f [set r]]
   184         -  }
   185         -  set myres
   186         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
          182  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          183  +    lappend myres [format %.2f [set r]]
          184  +  }
          185  +  set myres
          186  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
          187  +
          188  +do_test 1.1.8.2 {
          189  +  set myres {}
          190  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          191  +    lappend myres [format %.2f [set r]]
          192  +  }
          193  +  set myres
          194  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
          195  +
          196  +do_test 1.1.8.3 {
          197  +  set myres {}
          198  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          199  +    lappend myres [format %.2f [set r]]
          200  +  }
          201  +  set myres
          202  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
          203  +
          204  +do_test 1.1.8.4 {
          205  +  set myres {}
          206  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          207  +    lappend myres [format %.2f [set r]]
          208  +  }
          209  +  set myres
          210  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
          211  +
          212  +do_test 1.1.8.5 {
          213  +  set myres {}
          214  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          215  +    lappend myres [format %.2f [set r]]
          216  +  }
          217  +  set myres
          218  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
          219  +
          220  +do_test 1.1.8.6 {
          221  +  set myres {}
          222  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          223  +    lappend myres [format %.2f [set r]]
          224  +  }
          225  +  set myres
          226  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
          227  +
          228  +do_test 1.1.8.1 {
          229  +  set myres {}
          230  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          231  +    lappend myres [format %.2f [set r]]
          232  +  }
          233  +  set myres
          234  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
          235  +
          236  +do_test 1.1.8.2 {
          237  +  set myres {}
          238  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          239  +    lappend myres [format %.2f [set r]]
          240  +  }
          241  +  set myres
          242  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
          243  +
          244  +do_test 1.1.8.3 {
          245  +  set myres {}
          246  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          247  +    lappend myres [format %.2f [set r]]
          248  +  }
          249  +  set myres
          250  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
          251  +
          252  +do_test 1.1.8.4 {
          253  +  set myres {}
          254  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          255  +    lappend myres [format %.2f [set r]]
          256  +  }
          257  +  set myres
          258  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
          259  +
          260  +do_test 1.1.8.5 {
          261  +  set myres {}
          262  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
          263  +    lappend myres [format %.2f [set r]]
          264  +  }
          265  +  set myres
          266  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
          267  +
          268  +do_test 1.1.8.6 {
          269  +  set myres {}
          270  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2}] {
          271  +    lappend myres [format %.2f [set r]]
          272  +  }
          273  +  set myres
          274  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
   187    275   
   188    276   do_execsql_test 1.2.2.1 {
   189    277     SELECT max(b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
   190    278   } {99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99}
   191    279   
   192    280   do_execsql_test 1.2.2.2 {
   193    281     SELECT min(b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
................................................................................
   303    391       lappend myres [format %.2f [set r]]
   304    392     }
   305    393     set myres
   306    394   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
   307    395   
   308    396   do_test 1.2.8.1 {
   309    397     set myres {}
   310         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
   311         -    lappend myres [format %.2f [set r]]
   312         -  }
   313         -  set myres
   314         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
          398  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          399  +    lappend myres [format %.2f [set r]]
          400  +  }
          401  +  set myres
          402  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
          403  +
          404  +do_test 1.2.8.2 {
          405  +  set myres {}
          406  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          407  +    lappend myres [format %.2f [set r]]
          408  +  }
          409  +  set myres
          410  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
          411  +
          412  +do_test 1.2.8.3 {
          413  +  set myres {}
          414  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          415  +    lappend myres [format %.2f [set r]]
          416  +  }
          417  +  set myres
          418  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
          419  +
          420  +do_test 1.2.8.4 {
          421  +  set myres {}
          422  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          423  +    lappend myres [format %.2f [set r]]
          424  +  }
          425  +  set myres
          426  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
          427  +
          428  +do_test 1.2.8.5 {
          429  +  set myres {}
          430  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          431  +    lappend myres [format %.2f [set r]]
          432  +  }
          433  +  set myres
          434  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
          435  +
          436  +do_test 1.2.8.6 {
          437  +  set myres {}
          438  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          439  +    lappend myres [format %.2f [set r]]
          440  +  }
          441  +  set myres
          442  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
          443  +
          444  +do_test 1.2.8.1 {
          445  +  set myres {}
          446  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          447  +    lappend myres [format %.2f [set r]]
          448  +  }
          449  +  set myres
          450  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
          451  +
          452  +do_test 1.2.8.2 {
          453  +  set myres {}
          454  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          455  +    lappend myres [format %.2f [set r]]
          456  +  }
          457  +  set myres
          458  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
          459  +
          460  +do_test 1.2.8.3 {
          461  +  set myres {}
          462  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          463  +    lappend myres [format %.2f [set r]]
          464  +  }
          465  +  set myres
          466  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
          467  +
          468  +do_test 1.2.8.4 {
          469  +  set myres {}
          470  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          471  +    lappend myres [format %.2f [set r]]
          472  +  }
          473  +  set myres
          474  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
          475  +
          476  +do_test 1.2.8.5 {
          477  +  set myres {}
          478  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
          479  +    lappend myres [format %.2f [set r]]
          480  +  }
          481  +  set myres
          482  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
          483  +
          484  +do_test 1.2.8.6 {
          485  +  set myres {}
          486  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2}] {
          487  +    lappend myres [format %.2f [set r]]
          488  +  }
          489  +  set myres
          490  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
   315    491   
   316    492   do_execsql_test 1.3.2.1 {
   317    493     SELECT max(b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2
   318    494   } {0   74   41   74   23   99   26   33   2   89   81   96   59   38   68   39   62   91   46   6   99   97   27   46   78   54   97   8   67   29   93   84   77   23   16   16   93   65   35   47   7   86   74   61   91   85   24   85   43   59   12   32   56   3   91   22   90   55   15   28   89   25   47   1   56   40   43   56   16   75   36   89   98   76   81   4   94   42   30   78   33   29   53   63   2   87   37   80   84   72   41   9   61   73   95   65   13   58   96   98   1   21   74   65   35   5   73   11   51   87   41   12   8   20   31   31   15   95   22   73   79   88   34   8   11   49   34   90   59   96   60   55   75   77   44   2   7   85   57   74   29   70   59   19   39   26   26   47   80   90   36   58   47   9   72   72   66   33   93   75   64   81   9   23   37   13   12   14   62   91   36   91   33   15   34   36   99   3   95   69   58   52   30   50   84   10   84   33   21   39   44   58   30   38   34   83   27   82   17   7}
   319    495   
   320    496   do_execsql_test 1.3.2.2 {
   321    497     SELECT min(b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2
................................................................................
   431    607       lappend myres [format %.2f [set r]]
   432    608     }
   433    609     set myres
   434    610   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
   435    611   
   436    612   do_test 1.3.8.1 {
   437    613     set myres {}
   438         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
   439         -    lappend myres [format %.2f [set r]]
   440         -  }
   441         -  set myres
   442         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
          614  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          615  +    lappend myres [format %.2f [set r]]
          616  +  }
          617  +  set myres
          618  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
          619  +
          620  +do_test 1.3.8.2 {
          621  +  set myres {}
          622  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          623  +    lappend myres [format %.2f [set r]]
          624  +  }
          625  +  set myres
          626  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
          627  +
          628  +do_test 1.3.8.3 {
          629  +  set myres {}
          630  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          631  +    lappend myres [format %.2f [set r]]
          632  +  }
          633  +  set myres
          634  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
          635  +
          636  +do_test 1.3.8.4 {
          637  +  set myres {}
          638  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          639  +    lappend myres [format %.2f [set r]]
          640  +  }
          641  +  set myres
          642  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
          643  +
          644  +do_test 1.3.8.5 {
          645  +  set myres {}
          646  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          647  +    lappend myres [format %.2f [set r]]
          648  +  }
          649  +  set myres
          650  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
          651  +
          652  +do_test 1.3.8.6 {
          653  +  set myres {}
          654  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          655  +    lappend myres [format %.2f [set r]]
          656  +  }
          657  +  set myres
          658  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
          659  +
          660  +do_test 1.3.8.1 {
          661  +  set myres {}
          662  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          663  +    lappend myres [format %.2f [set r]]
          664  +  }
          665  +  set myres
          666  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
          667  +
          668  +do_test 1.3.8.2 {
          669  +  set myres {}
          670  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          671  +    lappend myres [format %.2f [set r]]
          672  +  }
          673  +  set myres
          674  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
          675  +
          676  +do_test 1.3.8.3 {
          677  +  set myres {}
          678  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          679  +    lappend myres [format %.2f [set r]]
          680  +  }
          681  +  set myres
          682  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
          683  +
          684  +do_test 1.3.8.4 {
          685  +  set myres {}
          686  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          687  +    lappend myres [format %.2f [set r]]
          688  +  }
          689  +  set myres
          690  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
          691  +
          692  +do_test 1.3.8.5 {
          693  +  set myres {}
          694  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
          695  +    lappend myres [format %.2f [set r]]
          696  +  }
          697  +  set myres
          698  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
          699  +
          700  +do_test 1.3.8.6 {
          701  +  set myres {}
          702  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW         AND CURRENT ROW) FROM t2}] {
          703  +    lappend myres [format %.2f [set r]]
          704  +  }
          705  +  set myres
          706  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
   443    707   
   444    708   do_execsql_test 1.4.2.1 {
   445    709     SELECT max(b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2
   446    710   } {99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   95   95   84   84   84   84   84   84   84   84   83   83   83   83   83   83   83   83   83   82   82   17   7}
   447    711   
   448    712   do_execsql_test 1.4.2.2 {
   449    713     SELECT min(b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2
................................................................................
   559    823       lappend myres [format %.2f [set r]]
   560    824     }
   561    825     set myres
   562    826   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
   563    827   
   564    828   do_test 1.4.8.1 {
   565    829     set myres {}
   566         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
   567         -    lappend myres [format %.2f [set r]]
   568         -  }
   569         -  set myres
   570         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
          830  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          831  +    lappend myres [format %.2f [set r]]
          832  +  }
          833  +  set myres
          834  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
          835  +
          836  +do_test 1.4.8.2 {
          837  +  set myres {}
          838  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          839  +    lappend myres [format %.2f [set r]]
          840  +  }
          841  +  set myres
          842  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
          843  +
          844  +do_test 1.4.8.3 {
          845  +  set myres {}
          846  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          847  +    lappend myres [format %.2f [set r]]
          848  +  }
          849  +  set myres
          850  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
          851  +
          852  +do_test 1.4.8.4 {
          853  +  set myres {}
          854  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          855  +    lappend myres [format %.2f [set r]]
          856  +  }
          857  +  set myres
          858  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
          859  +
          860  +do_test 1.4.8.5 {
          861  +  set myres {}
          862  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          863  +    lappend myres [format %.2f [set r]]
          864  +  }
          865  +  set myres
          866  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
          867  +
          868  +do_test 1.4.8.6 {
          869  +  set myres {}
          870  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          871  +    lappend myres [format %.2f [set r]]
          872  +  }
          873  +  set myres
          874  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
          875  +
          876  +do_test 1.4.8.1 {
          877  +  set myres {}
          878  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          879  +    lappend myres [format %.2f [set r]]
          880  +  }
          881  +  set myres
          882  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
          883  +
          884  +do_test 1.4.8.2 {
          885  +  set myres {}
          886  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          887  +    lappend myres [format %.2f [set r]]
          888  +  }
          889  +  set myres
          890  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
          891  +
          892  +do_test 1.4.8.3 {
          893  +  set myres {}
          894  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          895  +    lappend myres [format %.2f [set r]]
          896  +  }
          897  +  set myres
          898  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
          899  +
          900  +do_test 1.4.8.4 {
          901  +  set myres {}
          902  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          903  +    lappend myres [format %.2f [set r]]
          904  +  }
          905  +  set myres
          906  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
          907  +
          908  +do_test 1.4.8.5 {
          909  +  set myres {}
          910  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
          911  +    lappend myres [format %.2f [set r]]
          912  +  }
          913  +  set myres
          914  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
          915  +
          916  +do_test 1.4.8.6 {
          917  +  set myres {}
          918  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING) FROM t2}] {
          919  +    lappend myres [format %.2f [set r]]
          920  +  }
          921  +  set myres
          922  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
   571    923   
   572    924   do_execsql_test 1.5.2.1 {
   573    925     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
   574    926   } {{}   {}   {}   {}   0   74   74   74   74   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99}
   575    927   
   576    928   do_execsql_test 1.5.2.2 {
   577    929     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
................................................................................
   687   1039       lappend myres [format %.2f [set r]]
   688   1040     }
   689   1041     set myres
   690   1042   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
   691   1043   
   692   1044   do_test 1.5.8.1 {
   693   1045     set myres {}
   694         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
   695         -    lappend myres [format %.2f [set r]]
   696         -  }
   697         -  set myres
   698         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         1046  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1047  +    lappend myres [format %.2f [set r]]
         1048  +  }
         1049  +  set myres
         1050  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         1051  +
         1052  +do_test 1.5.8.2 {
         1053  +  set myres {}
         1054  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1055  +    lappend myres [format %.2f [set r]]
         1056  +  }
         1057  +  set myres
         1058  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         1059  +
         1060  +do_test 1.5.8.3 {
         1061  +  set myres {}
         1062  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1063  +    lappend myres [format %.2f [set r]]
         1064  +  }
         1065  +  set myres
         1066  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         1067  +
         1068  +do_test 1.5.8.4 {
         1069  +  set myres {}
         1070  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1071  +    lappend myres [format %.2f [set r]]
         1072  +  }
         1073  +  set myres
         1074  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         1075  +
         1076  +do_test 1.5.8.5 {
         1077  +  set myres {}
         1078  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1079  +    lappend myres [format %.2f [set r]]
         1080  +  }
         1081  +  set myres
         1082  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1083  +
         1084  +do_test 1.5.8.6 {
         1085  +  set myres {}
         1086  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1087  +    lappend myres [format %.2f [set r]]
         1088  +  }
         1089  +  set myres
         1090  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1091  +
         1092  +do_test 1.5.8.1 {
         1093  +  set myres {}
         1094  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1095  +    lappend myres [format %.2f [set r]]
         1096  +  }
         1097  +  set myres
         1098  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         1099  +
         1100  +do_test 1.5.8.2 {
         1101  +  set myres {}
         1102  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1103  +    lappend myres [format %.2f [set r]]
         1104  +  }
         1105  +  set myres
         1106  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1107  +
         1108  +do_test 1.5.8.3 {
         1109  +  set myres {}
         1110  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1111  +    lappend myres [format %.2f [set r]]
         1112  +  }
         1113  +  set myres
         1114  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         1115  +
         1116  +do_test 1.5.8.4 {
         1117  +  set myres {}
         1118  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1119  +    lappend myres [format %.2f [set r]]
         1120  +  }
         1121  +  set myres
         1122  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1123  +
         1124  +do_test 1.5.8.5 {
         1125  +  set myres {}
         1126  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
         1127  +    lappend myres [format %.2f [set r]]
         1128  +  }
         1129  +  set myres
         1130  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         1131  +
         1132  +do_test 1.5.8.6 {
         1133  +  set myres {}
         1134  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2}] {
         1135  +    lappend myres [format %.2f [set r]]
         1136  +  }
         1137  +  set myres
         1138  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
   699   1139   
   700   1140   do_execsql_test 1.6.2.1 {
   701   1141     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2
   702   1142   } {{}   {}   0   74   74   74   74   99   99   99   33   89   89   96   96   96   68   68   68   91   91   91   99   99   99   97   78   78   97   97   97   67   93   93   93   84   77   23   93   93   93   65   47   86   86   86   91   91   91   85   85   85   59   59   56   56   91   91   91   90   90   55   89   89   89   47   56   56   56   56   56   75   75   89   98   98   98   81   94   94   94   78   78   78   53   63   63   87   87   87   84   84   84   72   61   73   95   95   95   65   96   98   98   98   74   74   74   65   73   73   73   87   87   87   41   20   31   31   31   95   95   95   79   88   88   88   34   49   49   90   90   96   96   96   75   77   77   77   44   85   85   85   74   74   70   70   59   39   39   47   80   90   90   90   58   58   72   72   72   72   93   93   93   81   81   81   37   37   37   14   62   91   91   91   91   91   34   36   99   99   99   95   95   69   58   52   84   84   84   84   84   39   44   58   58   58   38   83   83   83}
   703   1143   
   704   1144   do_execsql_test 1.6.2.2 {
   705   1145     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2
................................................................................
   815   1255       lappend myres [format %.2f [set r]]
   816   1256     }
   817   1257     set myres
   818   1258   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
   819   1259   
   820   1260   do_test 1.6.8.1 {
   821   1261     set myres {}
   822         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
   823         -    lappend myres [format %.2f [set r]]
   824         -  }
   825         -  set myres
   826         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         1262  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1263  +    lappend myres [format %.2f [set r]]
         1264  +  }
         1265  +  set myres
         1266  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         1267  +
         1268  +do_test 1.6.8.2 {
         1269  +  set myres {}
         1270  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1271  +    lappend myres [format %.2f [set r]]
         1272  +  }
         1273  +  set myres
         1274  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         1275  +
         1276  +do_test 1.6.8.3 {
         1277  +  set myres {}
         1278  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1279  +    lappend myres [format %.2f [set r]]
         1280  +  }
         1281  +  set myres
         1282  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         1283  +
         1284  +do_test 1.6.8.4 {
         1285  +  set myres {}
         1286  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1287  +    lappend myres [format %.2f [set r]]
         1288  +  }
         1289  +  set myres
         1290  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         1291  +
         1292  +do_test 1.6.8.5 {
         1293  +  set myres {}
         1294  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1295  +    lappend myres [format %.2f [set r]]
         1296  +  }
         1297  +  set myres
         1298  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1299  +
         1300  +do_test 1.6.8.6 {
         1301  +  set myres {}
         1302  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1303  +    lappend myres [format %.2f [set r]]
         1304  +  }
         1305  +  set myres
         1306  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1307  +
         1308  +do_test 1.6.8.1 {
         1309  +  set myres {}
         1310  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1311  +    lappend myres [format %.2f [set r]]
         1312  +  }
         1313  +  set myres
         1314  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         1315  +
         1316  +do_test 1.6.8.2 {
         1317  +  set myres {}
         1318  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1319  +    lappend myres [format %.2f [set r]]
         1320  +  }
         1321  +  set myres
         1322  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1323  +
         1324  +do_test 1.6.8.3 {
         1325  +  set myres {}
         1326  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1327  +    lappend myres [format %.2f [set r]]
         1328  +  }
         1329  +  set myres
         1330  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         1331  +
         1332  +do_test 1.6.8.4 {
         1333  +  set myres {}
         1334  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1335  +    lappend myres [format %.2f [set r]]
         1336  +  }
         1337  +  set myres
         1338  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1339  +
         1340  +do_test 1.6.8.5 {
         1341  +  set myres {}
         1342  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING ) FROM t2}] {
         1343  +    lappend myres [format %.2f [set r]]
         1344  +  }
         1345  +  set myres
         1346  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         1347  +
         1348  +do_test 1.6.8.6 {
         1349  +  set myres {}
         1350  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND 2 PRECEDING) FROM t2}] {
         1351  +    lappend myres [format %.2f [set r]]
         1352  +  }
         1353  +  set myres
         1354  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
   827   1355   
   828   1356   do_execsql_test 1.7.2.1 {
   829   1357     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
   830   1358   } {0   74   74   74   74   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99}
   831   1359   
   832   1360   do_execsql_test 1.7.2.2 {
   833   1361     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
................................................................................
   943   1471       lappend myres [format %.2f [set r]]
   944   1472     }
   945   1473     set myres
   946   1474   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
   947   1475   
   948   1476   do_test 1.7.8.1 {
   949   1477     set myres {}
   950         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
   951         -    lappend myres [format %.2f [set r]]
   952         -  }
   953         -  set myres
   954         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         1478  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1479  +    lappend myres [format %.2f [set r]]
         1480  +  }
         1481  +  set myres
         1482  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         1483  +
         1484  +do_test 1.7.8.2 {
         1485  +  set myres {}
         1486  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1487  +    lappend myres [format %.2f [set r]]
         1488  +  }
         1489  +  set myres
         1490  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         1491  +
         1492  +do_test 1.7.8.3 {
         1493  +  set myres {}
         1494  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1495  +    lappend myres [format %.2f [set r]]
         1496  +  }
         1497  +  set myres
         1498  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         1499  +
         1500  +do_test 1.7.8.4 {
         1501  +  set myres {}
         1502  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1503  +    lappend myres [format %.2f [set r]]
         1504  +  }
         1505  +  set myres
         1506  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         1507  +
         1508  +do_test 1.7.8.5 {
         1509  +  set myres {}
         1510  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1511  +    lappend myres [format %.2f [set r]]
         1512  +  }
         1513  +  set myres
         1514  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1515  +
         1516  +do_test 1.7.8.6 {
         1517  +  set myres {}
         1518  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1519  +    lappend myres [format %.2f [set r]]
         1520  +  }
         1521  +  set myres
         1522  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1523  +
         1524  +do_test 1.7.8.1 {
         1525  +  set myres {}
         1526  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1527  +    lappend myres [format %.2f [set r]]
         1528  +  }
         1529  +  set myres
         1530  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         1531  +
         1532  +do_test 1.7.8.2 {
         1533  +  set myres {}
         1534  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1535  +    lappend myres [format %.2f [set r]]
         1536  +  }
         1537  +  set myres
         1538  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1539  +
         1540  +do_test 1.7.8.3 {
         1541  +  set myres {}
         1542  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1543  +    lappend myres [format %.2f [set r]]
         1544  +  }
         1545  +  set myres
         1546  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         1547  +
         1548  +do_test 1.7.8.4 {
         1549  +  set myres {}
         1550  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1551  +    lappend myres [format %.2f [set r]]
         1552  +  }
         1553  +  set myres
         1554  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1555  +
         1556  +do_test 1.7.8.5 {
         1557  +  set myres {}
         1558  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
         1559  +    lappend myres [format %.2f [set r]]
         1560  +  }
         1561  +  set myres
         1562  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         1563  +
         1564  +do_test 1.7.8.6 {
         1565  +  set myres {}
         1566  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2}] {
         1567  +    lappend myres [format %.2f [set r]]
         1568  +  }
         1569  +  set myres
         1570  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
   955   1571   
   956   1572   do_execsql_test 1.8.2.1 {
   957   1573     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2
   958   1574   } {0   74   74   74   74   99   99   99   99   99   89   96   96   96   96   96   68   91   91   91   99   99   99   99   99   97   97   97   97   97   97   93   93   93   93   84   93   93   93   93   93   86   86   86   91   91   91   91   91   85   85   85   59   59   91   91   91   91   91   90   90   89   89   89   89   56   56   56   56   75   75   89   98   98   98   98   98   94   94   94   94   78   78   78   63   87   87   87   87   87   84   84   84   73   95   95   95   95   96   98   98   98   98   98   74   74   74   73   73   87   87   87   87   87   41   31   31   95   95   95   95   95   88   88   88   88   49   90   90   96   96   96   96   96   77   77   77   85   85   85   85   85   74   74   70   70   59   47   80   90   90   90   90   90   72   72   72   72   93   93   93   93   93   81   81   81   37   37   62   91   91   91   91   91   91   91   99   99   99   99   99   95   95   69   84   84   84   84   84   84   84   58   58   58   58   83   83   83   83   83}
   959   1575   
   960   1576   do_execsql_test 1.8.2.2 {
   961   1577     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2
................................................................................
  1071   1687       lappend myres [format %.2f [set r]]
  1072   1688     }
  1073   1689     set myres
  1074   1690   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  1075   1691   
  1076   1692   do_test 1.8.8.1 {
  1077   1693     set myres {}
  1078         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
  1079         -    lappend myres [format %.2f [set r]]
  1080         -  }
  1081         -  set myres
  1082         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         1694  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1695  +    lappend myres [format %.2f [set r]]
         1696  +  }
         1697  +  set myres
         1698  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         1699  +
         1700  +do_test 1.8.8.2 {
         1701  +  set myres {}
         1702  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1703  +    lappend myres [format %.2f [set r]]
         1704  +  }
         1705  +  set myres
         1706  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         1707  +
         1708  +do_test 1.8.8.3 {
         1709  +  set myres {}
         1710  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1711  +    lappend myres [format %.2f [set r]]
         1712  +  }
         1713  +  set myres
         1714  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         1715  +
         1716  +do_test 1.8.8.4 {
         1717  +  set myres {}
         1718  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1719  +    lappend myres [format %.2f [set r]]
         1720  +  }
         1721  +  set myres
         1722  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         1723  +
         1724  +do_test 1.8.8.5 {
         1725  +  set myres {}
         1726  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1727  +    lappend myres [format %.2f [set r]]
         1728  +  }
         1729  +  set myres
         1730  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1731  +
         1732  +do_test 1.8.8.6 {
         1733  +  set myres {}
         1734  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1735  +    lappend myres [format %.2f [set r]]
         1736  +  }
         1737  +  set myres
         1738  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1739  +
         1740  +do_test 1.8.8.1 {
         1741  +  set myres {}
         1742  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1743  +    lappend myres [format %.2f [set r]]
         1744  +  }
         1745  +  set myres
         1746  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         1747  +
         1748  +do_test 1.8.8.2 {
         1749  +  set myres {}
         1750  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1751  +    lappend myres [format %.2f [set r]]
         1752  +  }
         1753  +  set myres
         1754  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1755  +
         1756  +do_test 1.8.8.3 {
         1757  +  set myres {}
         1758  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1759  +    lappend myres [format %.2f [set r]]
         1760  +  }
         1761  +  set myres
         1762  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         1763  +
         1764  +do_test 1.8.8.4 {
         1765  +  set myres {}
         1766  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1767  +    lappend myres [format %.2f [set r]]
         1768  +  }
         1769  +  set myres
         1770  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1771  +
         1772  +do_test 1.8.8.5 {
         1773  +  set myres {}
         1774  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW ) FROM t2}] {
         1775  +    lappend myres [format %.2f [set r]]
         1776  +  }
         1777  +  set myres
         1778  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         1779  +
         1780  +do_test 1.8.8.6 {
         1781  +  set myres {}
         1782  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND CURRENT ROW) FROM t2}] {
         1783  +    lappend myres [format %.2f [set r]]
         1784  +  }
         1785  +  set myres
         1786  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  1083   1787   
  1084   1788   do_execsql_test 1.9.2.1 {
  1085   1789     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2
  1086   1790   } {0   74   41   74   23   99   26   33   2   89   81   96   59   38   68   39   62   91   46   6   99   97   27   46   78   54   97   8   67   29   93   84   77   23   16   16   93   65   35   47   7   86   74   61   91   85   24   85   43   59   12   32   56   3   91   22   90   55   15   28   89   25   47   1   56   40   43   56   16   75   36   89   98   76   81   4   94   42   30   78   33   29   53   63   2   87   37   80   84   72   41   9   61   73   95   65   13   58   96   98   1   21   74   65   35   5   73   11   51   87   41   12   8   20   31   31   15   95   22   73   79   88   34   8   11   49   34   90   59   96   60   55   75   77   44   2   7   85   57   74   29   70   59   19   39   26   26   47   80   90   36   58   47   9   72   72   66   33   93   75   64   81   9   23   37   13   12   14   62   91   36   91   33   15   34   36   99   3   95   69   58   52   30   50   84   10   84   33   21   39   44   58   30   38   34   83   27   82   17   7}
  1087   1791   
  1088   1792   do_execsql_test 1.9.2.2 {
  1089   1793     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2
................................................................................
  1199   1903       lappend myres [format %.2f [set r]]
  1200   1904     }
  1201   1905     set myres
  1202   1906   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  1203   1907   
  1204   1908   do_test 1.9.8.1 {
  1205   1909     set myres {}
  1206         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
  1207         -    lappend myres [format %.2f [set r]]
  1208         -  }
  1209         -  set myres
  1210         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         1910  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1911  +    lappend myres [format %.2f [set r]]
         1912  +  }
         1913  +  set myres
         1914  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         1915  +
         1916  +do_test 1.9.8.2 {
         1917  +  set myres {}
         1918  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1919  +    lappend myres [format %.2f [set r]]
         1920  +  }
         1921  +  set myres
         1922  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         1923  +
         1924  +do_test 1.9.8.3 {
         1925  +  set myres {}
         1926  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1927  +    lappend myres [format %.2f [set r]]
         1928  +  }
         1929  +  set myres
         1930  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         1931  +
         1932  +do_test 1.9.8.4 {
         1933  +  set myres {}
         1934  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1935  +    lappend myres [format %.2f [set r]]
         1936  +  }
         1937  +  set myres
         1938  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         1939  +
         1940  +do_test 1.9.8.5 {
         1941  +  set myres {}
         1942  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1943  +    lappend myres [format %.2f [set r]]
         1944  +  }
         1945  +  set myres
         1946  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1947  +
         1948  +do_test 1.9.8.6 {
         1949  +  set myres {}
         1950  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1951  +    lappend myres [format %.2f [set r]]
         1952  +  }
         1953  +  set myres
         1954  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         1955  +
         1956  +do_test 1.9.8.1 {
         1957  +  set myres {}
         1958  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1959  +    lappend myres [format %.2f [set r]]
         1960  +  }
         1961  +  set myres
         1962  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         1963  +
         1964  +do_test 1.9.8.2 {
         1965  +  set myres {}
         1966  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1967  +    lappend myres [format %.2f [set r]]
         1968  +  }
         1969  +  set myres
         1970  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1971  +
         1972  +do_test 1.9.8.3 {
         1973  +  set myres {}
         1974  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1975  +    lappend myres [format %.2f [set r]]
         1976  +  }
         1977  +  set myres
         1978  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         1979  +
         1980  +do_test 1.9.8.4 {
         1981  +  set myres {}
         1982  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1983  +    lappend myres [format %.2f [set r]]
         1984  +  }
         1985  +  set myres
         1986  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         1987  +
         1988  +do_test 1.9.8.5 {
         1989  +  set myres {}
         1990  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW         AND CURRENT ROW ) FROM t2}] {
         1991  +    lappend myres [format %.2f [set r]]
         1992  +  }
         1993  +  set myres
         1994  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         1995  +
         1996  +do_test 1.9.8.6 {
         1997  +  set myres {}
         1998  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND CURRENT ROW) FROM t2}] {
         1999  +    lappend myres [format %.2f [set r]]
         2000  +  }
         2001  +  set myres
         2002  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  1211   2003   
  1212   2004   do_execsql_test 1.10.2.1 {
  1213   2005     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
  1214   2006   } {74   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99}
  1215   2007   
  1216   2008   do_execsql_test 1.10.2.2 {
  1217   2009     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
................................................................................
  1327   2119       lappend myres [format %.2f [set r]]
  1328   2120     }
  1329   2121     set myres
  1330   2122   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  1331   2123   
  1332   2124   do_test 1.10.8.1 {
  1333   2125     set myres {}
  1334         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
  1335         -    lappend myres [format %.2f [set r]]
  1336         -  }
  1337         -  set myres
  1338         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         2126  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2127  +    lappend myres [format %.2f [set r]]
         2128  +  }
         2129  +  set myres
         2130  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         2131  +
         2132  +do_test 1.10.8.2 {
         2133  +  set myres {}
         2134  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2135  +    lappend myres [format %.2f [set r]]
         2136  +  }
         2137  +  set myres
         2138  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         2139  +
         2140  +do_test 1.10.8.3 {
         2141  +  set myres {}
         2142  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2143  +    lappend myres [format %.2f [set r]]
         2144  +  }
         2145  +  set myres
         2146  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         2147  +
         2148  +do_test 1.10.8.4 {
         2149  +  set myres {}
         2150  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2151  +    lappend myres [format %.2f [set r]]
         2152  +  }
         2153  +  set myres
         2154  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         2155  +
         2156  +do_test 1.10.8.5 {
         2157  +  set myres {}
         2158  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2159  +    lappend myres [format %.2f [set r]]
         2160  +  }
         2161  +  set myres
         2162  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         2163  +
         2164  +do_test 1.10.8.6 {
         2165  +  set myres {}
         2166  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2167  +    lappend myres [format %.2f [set r]]
         2168  +  }
         2169  +  set myres
         2170  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         2171  +
         2172  +do_test 1.10.8.1 {
         2173  +  set myres {}
         2174  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2175  +    lappend myres [format %.2f [set r]]
         2176  +  }
         2177  +  set myres
         2178  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         2179  +
         2180  +do_test 1.10.8.2 {
         2181  +  set myres {}
         2182  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2183  +    lappend myres [format %.2f [set r]]
         2184  +  }
         2185  +  set myres
         2186  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         2187  +
         2188  +do_test 1.10.8.3 {
         2189  +  set myres {}
         2190  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2191  +    lappend myres [format %.2f [set r]]
         2192  +  }
         2193  +  set myres
         2194  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         2195  +
         2196  +do_test 1.10.8.4 {
         2197  +  set myres {}
         2198  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2199  +    lappend myres [format %.2f [set r]]
         2200  +  }
         2201  +  set myres
         2202  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         2203  +
         2204  +do_test 1.10.8.5 {
         2205  +  set myres {}
         2206  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
         2207  +    lappend myres [format %.2f [set r]]
         2208  +  }
         2209  +  set myres
         2210  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         2211  +
         2212  +do_test 1.10.8.6 {
         2213  +  set myres {}
         2214  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2}] {
         2215  +    lappend myres [format %.2f [set r]]
         2216  +  }
         2217  +  set myres
         2218  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  1339   2219   
  1340   2220   do_execsql_test 1.11.2.1 {
  1341   2221     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2
  1342   2222   } {74   74   74   99   99   99   99   99   99   99   96   96   96   96   96   96   91   91   99   99   99   99   99   99   99   97   97   97   97   97   97   93   93   93   93   93   93   93   93   93   93   86   91   91   91   91   91   91   91   85   85   85   91   91   91   91   91   91   91   90   90   89   89   89   89   56   56   75   75   89   98   98   98   98   98   98   98   94   94   94   94   78   78   87   87   87   87   87   87   87   84   84   95   95   95   95   96   98   98   98   98   98   98   98   74   74   74   87   87   87   87   87   87   87   41   95   95   95   95   95   95   95   88   88   88   90   90   96   96   96   96   96   96   96   77   85   85   85   85   85   85   85   74   74   70   70   80   90   90   90   90   90   90   90   72   72   93   93   93   93   93   93   93   81   81   81   62   91   91   91   91   91   91   91   99   99   99   99   99   99   99   95   95   84   84   84   84   84   84   84   84   58   58   83   83   83   83   83   83   83}
  1343   2223   
  1344   2224   do_execsql_test 1.11.2.2 {
  1345   2225     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2
................................................................................
  1455   2335       lappend myres [format %.2f [set r]]
  1456   2336     }
  1457   2337     set myres
  1458   2338   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  1459   2339   
  1460   2340   do_test 1.11.8.1 {
  1461   2341     set myres {}
  1462         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
  1463         -    lappend myres [format %.2f [set r]]
  1464         -  }
  1465         -  set myres
  1466         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         2342  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2343  +    lappend myres [format %.2f [set r]]
         2344  +  }
         2345  +  set myres
         2346  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         2347  +
         2348  +do_test 1.11.8.2 {
         2349  +  set myres {}
         2350  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2351  +    lappend myres [format %.2f [set r]]
         2352  +  }
         2353  +  set myres
         2354  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         2355  +
         2356  +do_test 1.11.8.3 {
         2357  +  set myres {}
         2358  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2359  +    lappend myres [format %.2f [set r]]
         2360  +  }
         2361  +  set myres
         2362  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         2363  +
         2364  +do_test 1.11.8.4 {
         2365  +  set myres {}
         2366  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2367  +    lappend myres [format %.2f [set r]]
         2368  +  }
         2369  +  set myres
         2370  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         2371  +
         2372  +do_test 1.11.8.5 {
         2373  +  set myres {}
         2374  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2375  +    lappend myres [format %.2f [set r]]
         2376  +  }
         2377  +  set myres
         2378  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         2379  +
         2380  +do_test 1.11.8.6 {
         2381  +  set myres {}
         2382  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2383  +    lappend myres [format %.2f [set r]]
         2384  +  }
         2385  +  set myres
         2386  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         2387  +
         2388  +do_test 1.11.8.1 {
         2389  +  set myres {}
         2390  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2391  +    lappend myres [format %.2f [set r]]
         2392  +  }
         2393  +  set myres
         2394  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         2395  +
         2396  +do_test 1.11.8.2 {
         2397  +  set myres {}
         2398  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2399  +    lappend myres [format %.2f [set r]]
         2400  +  }
         2401  +  set myres
         2402  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         2403  +
         2404  +do_test 1.11.8.3 {
         2405  +  set myres {}
         2406  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2407  +    lappend myres [format %.2f [set r]]
         2408  +  }
         2409  +  set myres
         2410  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         2411  +
         2412  +do_test 1.11.8.4 {
         2413  +  set myres {}
         2414  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2415  +    lappend myres [format %.2f [set r]]
         2416  +  }
         2417  +  set myres
         2418  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         2419  +
         2420  +do_test 1.11.8.5 {
         2421  +  set myres {}
         2422  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING ) FROM t2}] {
         2423  +    lappend myres [format %.2f [set r]]
         2424  +  }
         2425  +  set myres
         2426  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         2427  +
         2428  +do_test 1.11.8.6 {
         2429  +  set myres {}
         2430  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND 2 FOLLOWING) FROM t2}] {
         2431  +    lappend myres [format %.2f [set r]]
         2432  +  }
         2433  +  set myres
         2434  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  1467   2435   
  1468   2436   do_execsql_test 1.12.2.1 {
  1469   2437     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2
  1470   2438   } {74   99   99   99   99   99   89   96   96   96   96   96   68   91   91   91   99   99   99   99   99   97   97   97   97   97   97   93   93   93   93   84   93   93   93   93   93   86   86   86   91   91   91   91   91   85   85   85   59   59   91   91   91   91   91   90   90   89   89   89   89   56   56   56   56   75   75   89   98   98   98   98   98   94   94   94   94   78   78   78   63   87   87   87   87   87   84   84   84   73   95   95   95   95   96   98   98   98   98   98   74   74   74   73   73   87   87   87   87   87   41   31   31   95   95   95   95   95   88   88   88   88   49   90   90   96   96   96   96   96   77   77   77   85   85   85   85   85   74   74   70   70   59   47   80   90   90   90   90   90   72   72   72   72   93   93   93   93   93   81   81   81   37   37   62   91   91   91   91   91   91   91   99   99   99   99   99   95   95   69   84   84   84   84   84   84   84   58   58   58   58   83   83   83   83   83   82   82   17   7}
  1471   2439   
  1472   2440   do_execsql_test 1.12.2.2 {
  1473   2441     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2
................................................................................
  1583   2551       lappend myres [format %.2f [set r]]
  1584   2552     }
  1585   2553     set myres
  1586   2554   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  1587   2555   
  1588   2556   do_test 1.12.8.1 {
  1589   2557     set myres {}
  1590         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
  1591         -    lappend myres [format %.2f [set r]]
  1592         -  }
  1593         -  set myres
  1594         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         2558  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2559  +    lappend myres [format %.2f [set r]]
         2560  +  }
         2561  +  set myres
         2562  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         2563  +
         2564  +do_test 1.12.8.2 {
         2565  +  set myres {}
         2566  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2567  +    lappend myres [format %.2f [set r]]
         2568  +  }
         2569  +  set myres
         2570  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         2571  +
         2572  +do_test 1.12.8.3 {
         2573  +  set myres {}
         2574  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2575  +    lappend myres [format %.2f [set r]]
         2576  +  }
         2577  +  set myres
         2578  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         2579  +
         2580  +do_test 1.12.8.4 {
         2581  +  set myres {}
         2582  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2583  +    lappend myres [format %.2f [set r]]
         2584  +  }
         2585  +  set myres
         2586  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         2587  +
         2588  +do_test 1.12.8.5 {
         2589  +  set myres {}
         2590  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2591  +    lappend myres [format %.2f [set r]]
         2592  +  }
         2593  +  set myres
         2594  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         2595  +
         2596  +do_test 1.12.8.6 {
         2597  +  set myres {}
         2598  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2599  +    lappend myres [format %.2f [set r]]
         2600  +  }
         2601  +  set myres
         2602  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         2603  +
         2604  +do_test 1.12.8.1 {
         2605  +  set myres {}
         2606  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2607  +    lappend myres [format %.2f [set r]]
         2608  +  }
         2609  +  set myres
         2610  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         2611  +
         2612  +do_test 1.12.8.2 {
         2613  +  set myres {}
         2614  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2615  +    lappend myres [format %.2f [set r]]
         2616  +  }
         2617  +  set myres
         2618  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         2619  +
         2620  +do_test 1.12.8.3 {
         2621  +  set myres {}
         2622  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2623  +    lappend myres [format %.2f [set r]]
         2624  +  }
         2625  +  set myres
         2626  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         2627  +
         2628  +do_test 1.12.8.4 {
         2629  +  set myres {}
         2630  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2631  +    lappend myres [format %.2f [set r]]
         2632  +  }
         2633  +  set myres
         2634  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         2635  +
         2636  +do_test 1.12.8.5 {
         2637  +  set myres {}
         2638  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING ) FROM t2}] {
         2639  +    lappend myres [format %.2f [set r]]
         2640  +  }
         2641  +  set myres
         2642  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         2643  +
         2644  +do_test 1.12.8.6 {
         2645  +  set myres {}
         2646  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND 4 FOLLOWING) FROM t2}] {
         2647  +    lappend myres [format %.2f [set r]]
         2648  +  }
         2649  +  set myres
         2650  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  1595   2651   
  1596   2652   do_execsql_test 1.13.2.1 {
  1597   2653     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2
  1598   2654   } {74   99   99   99   33   89   89   96   96   96   68   68   68   91   91   91   99   99   99   97   78   78   97   97   97   67   93   93   93   84   77   23   93   93   93   65   47   86   86   86   91   91   91   85   85   85   59   59   56   56   91   91   91   90   90   55   89   89   89   47   56   56   56   56   56   75   75   89   98   98   98   81   94   94   94   78   78   78   53   63   63   87   87   87   84   84   84   72   61   73   95   95   95   65   96   98   98   98   74   74   74   65   73   73   73   87   87   87   41   20   31   31   31   95   95   95   79   88   88   88   34   49   49   90   90   96   96   96   75   77   77   77   44   85   85   85   74   74   70   70   59   39   39   47   80   90   90   90   58   58   72   72   72   72   93   93   93   81   81   81   37   37   37   14   62   91   91   91   91   91   34   36   99   99   99   95   95   69   58   52   84   84   84   84   84   39   44   58   58   58   38   83   83   83   82   82   17   7   {}   {}}
  1599   2655   
  1600   2656   do_execsql_test 1.13.2.2 {
  1601   2657     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2
................................................................................
  1711   2767       lappend myres [format %.2f [set r]]
  1712   2768     }
  1713   2769     set myres
  1714   2770   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  1715   2771   
  1716   2772   do_test 1.13.8.1 {
  1717   2773     set myres {}
  1718         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
  1719         -    lappend myres [format %.2f [set r]]
  1720         -  }
  1721         -  set myres
  1722         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         2774  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2775  +    lappend myres [format %.2f [set r]]
         2776  +  }
         2777  +  set myres
         2778  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         2779  +
         2780  +do_test 1.13.8.2 {
         2781  +  set myres {}
         2782  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2783  +    lappend myres [format %.2f [set r]]
         2784  +  }
         2785  +  set myres
         2786  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         2787  +
         2788  +do_test 1.13.8.3 {
         2789  +  set myres {}
         2790  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2791  +    lappend myres [format %.2f [set r]]
         2792  +  }
         2793  +  set myres
         2794  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         2795  +
         2796  +do_test 1.13.8.4 {
         2797  +  set myres {}
         2798  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2799  +    lappend myres [format %.2f [set r]]
         2800  +  }
         2801  +  set myres
         2802  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         2803  +
         2804  +do_test 1.13.8.5 {
         2805  +  set myres {}
         2806  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2807  +    lappend myres [format %.2f [set r]]
         2808  +  }
         2809  +  set myres
         2810  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         2811  +
         2812  +do_test 1.13.8.6 {
         2813  +  set myres {}
         2814  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2815  +    lappend myres [format %.2f [set r]]
         2816  +  }
         2817  +  set myres
         2818  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         2819  +
         2820  +do_test 1.13.8.1 {
         2821  +  set myres {}
         2822  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2823  +    lappend myres [format %.2f [set r]]
         2824  +  }
         2825  +  set myres
         2826  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         2827  +
         2828  +do_test 1.13.8.2 {
         2829  +  set myres {}
         2830  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2831  +    lappend myres [format %.2f [set r]]
         2832  +  }
         2833  +  set myres
         2834  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         2835  +
         2836  +do_test 1.13.8.3 {
         2837  +  set myres {}
         2838  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2839  +    lappend myres [format %.2f [set r]]
         2840  +  }
         2841  +  set myres
         2842  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         2843  +
         2844  +do_test 1.13.8.4 {
         2845  +  set myres {}
         2846  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2847  +    lappend myres [format %.2f [set r]]
         2848  +  }
         2849  +  set myres
         2850  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         2851  +
         2852  +do_test 1.13.8.5 {
         2853  +  set myres {}
         2854  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING ) FROM t2}] {
         2855  +    lappend myres [format %.2f [set r]]
         2856  +  }
         2857  +  set myres
         2858  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         2859  +
         2860  +do_test 1.13.8.6 {
         2861  +  set myres {}
         2862  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING    AND 4 FOLLOWING) FROM t2}] {
         2863  +    lappend myres [format %.2f [set r]]
         2864  +  }
         2865  +  set myres
         2866  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  1723   2867   
  1724   2868   do_execsql_test 1.14.2.1 {
  1725   2869     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
  1726   2870   } {99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99}
  1727   2871   
  1728   2872   do_execsql_test 1.14.2.2 {
  1729   2873     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
................................................................................
  1839   2983       lappend myres [format %.2f [set r]]
  1840   2984     }
  1841   2985     set myres
  1842   2986   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  1843   2987   
  1844   2988   do_test 1.14.8.1 {
  1845   2989     set myres {}
  1846         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
  1847         -    lappend myres [format %.2f [set r]]
  1848         -  }
  1849         -  set myres
  1850         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         2990  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         2991  +    lappend myres [format %.2f [set r]]
         2992  +  }
         2993  +  set myres
         2994  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         2995  +
         2996  +do_test 1.14.8.2 {
         2997  +  set myres {}
         2998  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         2999  +    lappend myres [format %.2f [set r]]
         3000  +  }
         3001  +  set myres
         3002  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         3003  +
         3004  +do_test 1.14.8.3 {
         3005  +  set myres {}
         3006  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3007  +    lappend myres [format %.2f [set r]]
         3008  +  }
         3009  +  set myres
         3010  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         3011  +
         3012  +do_test 1.14.8.4 {
         3013  +  set myres {}
         3014  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3015  +    lappend myres [format %.2f [set r]]
         3016  +  }
         3017  +  set myres
         3018  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         3019  +
         3020  +do_test 1.14.8.5 {
         3021  +  set myres {}
         3022  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3023  +    lappend myres [format %.2f [set r]]
         3024  +  }
         3025  +  set myres
         3026  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         3027  +
         3028  +do_test 1.14.8.6 {
         3029  +  set myres {}
         3030  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3031  +    lappend myres [format %.2f [set r]]
         3032  +  }
         3033  +  set myres
         3034  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         3035  +
         3036  +do_test 1.14.8.1 {
         3037  +  set myres {}
         3038  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3039  +    lappend myres [format %.2f [set r]]
         3040  +  }
         3041  +  set myres
         3042  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         3043  +
         3044  +do_test 1.14.8.2 {
         3045  +  set myres {}
         3046  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3047  +    lappend myres [format %.2f [set r]]
         3048  +  }
         3049  +  set myres
         3050  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         3051  +
         3052  +do_test 1.14.8.3 {
         3053  +  set myres {}
         3054  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3055  +    lappend myres [format %.2f [set r]]
         3056  +  }
         3057  +  set myres
         3058  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         3059  +
         3060  +do_test 1.14.8.4 {
         3061  +  set myres {}
         3062  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3063  +    lappend myres [format %.2f [set r]]
         3064  +  }
         3065  +  set myres
         3066  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         3067  +
         3068  +do_test 1.14.8.5 {
         3069  +  set myres {}
         3070  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3071  +    lappend myres [format %.2f [set r]]
         3072  +  }
         3073  +  set myres
         3074  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         3075  +
         3076  +do_test 1.14.8.6 {
         3077  +  set myres {}
         3078  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2}] {
         3079  +    lappend myres [format %.2f [set r]]
         3080  +  }
         3081  +  set myres
         3082  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  1851   3083   
  1852   3084   do_execsql_test 1.15.2.1 {
  1853   3085     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2
  1854   3086   } {99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   95   95   84   84   84   84   84   84   84   84   83   83   83   83   83   83   83   83   83}
  1855   3087   
  1856   3088   do_execsql_test 1.15.2.2 {
  1857   3089     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2
................................................................................
  1967   3199       lappend myres [format %.2f [set r]]
  1968   3200     }
  1969   3201     set myres
  1970   3202   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  1971   3203   
  1972   3204   do_test 1.15.8.1 {
  1973   3205     set myres {}
  1974         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
  1975         -    lappend myres [format %.2f [set r]]
  1976         -  }
  1977         -  set myres
  1978         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         3206  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3207  +    lappend myres [format %.2f [set r]]
         3208  +  }
         3209  +  set myres
         3210  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         3211  +
         3212  +do_test 1.15.8.2 {
         3213  +  set myres {}
         3214  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3215  +    lappend myres [format %.2f [set r]]
         3216  +  }
         3217  +  set myres
         3218  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         3219  +
         3220  +do_test 1.15.8.3 {
         3221  +  set myres {}
         3222  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3223  +    lappend myres [format %.2f [set r]]
         3224  +  }
         3225  +  set myres
         3226  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         3227  +
         3228  +do_test 1.15.8.4 {
         3229  +  set myres {}
         3230  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3231  +    lappend myres [format %.2f [set r]]
         3232  +  }
         3233  +  set myres
         3234  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         3235  +
         3236  +do_test 1.15.8.5 {
         3237  +  set myres {}
         3238  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3239  +    lappend myres [format %.2f [set r]]
         3240  +  }
         3241  +  set myres
         3242  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         3243  +
         3244  +do_test 1.15.8.6 {
         3245  +  set myres {}
         3246  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3247  +    lappend myres [format %.2f [set r]]
         3248  +  }
         3249  +  set myres
         3250  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         3251  +
         3252  +do_test 1.15.8.1 {
         3253  +  set myres {}
         3254  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3255  +    lappend myres [format %.2f [set r]]
         3256  +  }
         3257  +  set myres
         3258  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         3259  +
         3260  +do_test 1.15.8.2 {
         3261  +  set myres {}
         3262  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3263  +    lappend myres [format %.2f [set r]]
         3264  +  }
         3265  +  set myres
         3266  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         3267  +
         3268  +do_test 1.15.8.3 {
         3269  +  set myres {}
         3270  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3271  +    lappend myres [format %.2f [set r]]
         3272  +  }
         3273  +  set myres
         3274  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         3275  +
         3276  +do_test 1.15.8.4 {
         3277  +  set myres {}
         3278  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3279  +    lappend myres [format %.2f [set r]]
         3280  +  }
         3281  +  set myres
         3282  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         3283  +
         3284  +do_test 1.15.8.5 {
         3285  +  set myres {}
         3286  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3287  +    lappend myres [format %.2f [set r]]
         3288  +  }
         3289  +  set myres
         3290  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         3291  +
         3292  +do_test 1.15.8.6 {
         3293  +  set myres {}
         3294  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING    AND UNBOUNDED FOLLOWING) FROM t2}] {
         3295  +    lappend myres [format %.2f [set r]]
         3296  +  }
         3297  +  set myres
         3298  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  1979   3299   
  1980   3300   do_execsql_test 1.16.2.1 {
  1981   3301     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2
  1982   3302   } {99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   95   95   84   84   84   84   84   84   84   84   83   83   83   83   83   83   83   83   83   82   82   17   7}
  1983   3303   
  1984   3304   do_execsql_test 1.16.2.2 {
  1985   3305     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2
................................................................................
  2095   3415       lappend myres [format %.2f [set r]]
  2096   3416     }
  2097   3417     set myres
  2098   3418   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  2099   3419   
  2100   3420   do_test 1.16.8.1 {
  2101   3421     set myres {}
  2102         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
  2103         -    lappend myres [format %.2f [set r]]
  2104         -  }
  2105         -  set myres
  2106         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         3422  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3423  +    lappend myres [format %.2f [set r]]
         3424  +  }
         3425  +  set myres
         3426  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         3427  +
         3428  +do_test 1.16.8.2 {
         3429  +  set myres {}
         3430  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3431  +    lappend myres [format %.2f [set r]]
         3432  +  }
         3433  +  set myres
         3434  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         3435  +
         3436  +do_test 1.16.8.3 {
         3437  +  set myres {}
         3438  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3439  +    lappend myres [format %.2f [set r]]
         3440  +  }
         3441  +  set myres
         3442  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         3443  +
         3444  +do_test 1.16.8.4 {
         3445  +  set myres {}
         3446  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3447  +    lappend myres [format %.2f [set r]]
         3448  +  }
         3449  +  set myres
         3450  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         3451  +
         3452  +do_test 1.16.8.5 {
         3453  +  set myres {}
         3454  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3455  +    lappend myres [format %.2f [set r]]
         3456  +  }
         3457  +  set myres
         3458  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         3459  +
         3460  +do_test 1.16.8.6 {
         3461  +  set myres {}
         3462  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3463  +    lappend myres [format %.2f [set r]]
         3464  +  }
         3465  +  set myres
         3466  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         3467  +
         3468  +do_test 1.16.8.1 {
         3469  +  set myres {}
         3470  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3471  +    lappend myres [format %.2f [set r]]
         3472  +  }
         3473  +  set myres
         3474  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         3475  +
         3476  +do_test 1.16.8.2 {
         3477  +  set myres {}
         3478  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3479  +    lappend myres [format %.2f [set r]]
         3480  +  }
         3481  +  set myres
         3482  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         3483  +
         3484  +do_test 1.16.8.3 {
         3485  +  set myres {}
         3486  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3487  +    lappend myres [format %.2f [set r]]
         3488  +  }
         3489  +  set myres
         3490  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         3491  +
         3492  +do_test 1.16.8.4 {
         3493  +  set myres {}
         3494  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3495  +    lappend myres [format %.2f [set r]]
         3496  +  }
         3497  +  set myres
         3498  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         3499  +
         3500  +do_test 1.16.8.5 {
         3501  +  set myres {}
         3502  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3503  +    lappend myres [format %.2f [set r]]
         3504  +  }
         3505  +  set myres
         3506  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         3507  +
         3508  +do_test 1.16.8.6 {
         3509  +  set myres {}
         3510  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW         AND UNBOUNDED FOLLOWING) FROM t2}] {
         3511  +    lappend myres [format %.2f [set r]]
         3512  +  }
         3513  +  set myres
         3514  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  2107   3515   
  2108   3516   do_execsql_test 1.17.2.1 {
  2109   3517     SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2
  2110   3518   } {99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   99   95   95   84   84   84   84   84   84   84   84   83   83   83   83   83   83   83   83   83   82   82   17   7   {}   {}   {}   {}}
  2111   3519   
  2112   3520   do_execsql_test 1.17.2.2 {
  2113   3521     SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2
................................................................................
  2223   3631       lappend myres [format %.2f [set r]]
  2224   3632     }
  2225   3633     set myres
  2226   3634   } {0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.17 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.83 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80}
  2227   3635   
  2228   3636   do_test 1.17.8.1 {
  2229   3637     set myres {}
  2230         -  foreach r [db eval {SELECT b, cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3638  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3639  +    lappend myres [format %.2f [set r]]
         3640  +  }
         3641  +  set myres
         3642  +} {0.01 0.01 0.01 0.02 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.06 0.07 0.07 0.07 0.08 0.09 0.09 0.10 0.10 0.10 0.11 0.12 0.12 0.12 0.13 0.14 0.14 0.14 0.15 0.15 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.20 0.21 0.21 0.22 0.23 0.23 0.23 0.24 0.24 0.25 0.26 0.26 0.27 0.27 0.28 0.28 0.28 0.29 0.29 0.30 0.30 0.31 0.32 0.32 0.33 0.33 0.34 0.34 0.34 0.35 0.35 0.36 0.36 0.37 0.38 0.38 0.39 0.39 0.40 0.40 0.41 0.41 0.41 0.42 0.42 0.43 0.43 0.44 0.45 0.45 0.46 0.46 0.47 0.47 0.47 0.48 0.48 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.53 0.54 0.54 0.55 0.55 0.56 0.56 0.56 0.57 0.57 0.58 0.58 0.59 0.59 0.60 0.60 0.61 0.61 0.62 0.62 0.63 0.64 0.64 0.65 0.65 0.66 0.66 0.67 0.67 0.68 0.68 0.69 0.69 0.69 0.70 0.70 0.71 0.71 0.72 0.72 0.73 0.73 0.74 0.74 0.75 0.76 0.76 0.77 0.77 0.78 0.78 0.79 0.79 0.80 0.80 0.81 0.81 0.81 0.82 0.82 0.83 0.83 0.84 0.84 0.85 0.85 0.86 0.86 0.87 0.88 0.88 0.89 0.89 0.90 0.90 0.91 0.91 0.92 0.92 0.93 0.93 0.94 0.94 0.94 0.95 0.95 0.96 0.96 0.97 0.97 0.98 0.98 0.99 0.99 1.00}
         3643  +
         3644  +do_test 1.17.8.2 {
         3645  +  set myres {}
         3646  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3647  +    lappend myres [format %.2f [set r]]
         3648  +  }
         3649  +  set myres
         3650  +} {0.07 0.13 0.20 0.27 0.33 0.40 0.47 0.53 0.60 0.67 0.73 0.80 0.87 0.93 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.06 0.12 0.18 0.24 0.29 0.35 0.41 0.47 0.53 0.59 0.65 0.71 0.76 0.82 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.10 0.14 0.19 0.24 0.29 0.33 0.38 0.43 0.48 0.52 0.57 0.62 0.67 0.71 0.76 0.81 0.86 0.90 0.95 1.00 0.05 0.09 0.14 0.18 0.23 0.27 0.32 0.36 0.41 0.45 0.50 0.55 0.59 0.64 0.68 0.73 0.77 0.82 0.86 0.91 0.95 1.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.06 0.12 0.19 0.25 0.31 0.38 0.44 0.50 0.56 0.62 0.69 0.75 0.81 0.88 0.94 1.00 0.04 0.09 0.13 0.17 0.22 0.26 0.30 0.35 0.39 0.43 0.48 0.52 0.57 0.61 0.65 0.70 0.74 0.78 0.83 0.87 0.91 0.96 1.00}
         3651  +
         3652  +do_test 1.17.8.3 {
         3653  +  set myres {}
         3654  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3655  +    lappend myres [format %.2f [set r]]
         3656  +  }
         3657  +  set myres
         3658  +} {0.01 0.01 0.01 0.03 0.03 0.03 0.04 0.04 0.04 0.05 0.06 0.07 0.07 0.07 0.09 0.09 0.09 0.10 0.10 0.10 0.10 0.12 0.12 0.13 0.13 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.17 0.17 0.17 0.18 0.18 0.19 0.20 0.20 0.21 0.21 0.23 0.23 0.23 0.23 0.23 0.25 0.25 0.25 0.26 0.26 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.30 0.30 0.31 0.34 0.34 0.34 0.34 0.34 0.35 0.35 0.35 0.35 0.36 0.36 0.39 0.39 0.39 0.39 0.40 0.40 0.41 0.41 0.42 0.42 0.42 0.42 0.44 0.44 0.44 0.45 0.46 0.46 0.47 0.47 0.47 0.47 0.49 0.49 0.49 0.49 0.50 0.51 0.51 0.52 0.52 0.53 0.54 0.54 0.55 0.55 0.55 0.56 0.57 0.57 0.57 0.57 0.59 0.59 0.59 0.59 0.60 0.61 0.61 0.62 0.62 0.62 0.63 0.65 0.65 0.65 0.65 0.66 0.66 0.67 0.67 0.69 0.69 0.69 0.70 0.70 0.70 0.72 0.72 0.72 0.72 0.72 0.74 0.74 0.74 0.74 0.76 0.76 0.77 0.77 0.77 0.78 0.78 0.80 0.80 0.80 0.80 0.81 0.82 0.82 0.82 0.82 0.84 0.84 0.84 0.84 0.85 0.85 0.86 0.88 0.88 0.88 0.89 0.89 0.89 0.92 0.92 0.92 0.92 0.92 0.93 0.93 0.93 0.94 0.95 0.95 0.95 0.96 0.96 0.96 0.97 0.97 0.98 0.98 1.00 1.00 1.00}
         3659  +
         3660  +do_test 1.17.8.4 {
         3661  +  set myres {}
         3662  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3663  +    lappend myres [format %.2f [set r]]
         3664  +  }
         3665  +  set myres
         3666  +} {0.07 0.13 0.20 0.40 0.40 0.40 0.47 0.53 0.60 0.67 0.80 0.80 1.00 1.00 1.00 0.09 0.09 0.18 0.18 0.27 0.27 0.36 0.36 0.50 0.50 0.50 0.55 0.64 0.64 0.77 0.77 0.77 1.00 1.00 1.00 1.00 1.00 0.18 0.18 0.18 0.35 0.35 0.35 0.47 0.47 0.53 0.59 0.65 0.76 0.76 0.94 0.94 0.94 1.00 0.09 0.09 0.17 0.17 0.30 0.30 0.30 0.52 0.52 0.52 0.52 0.52 0.61 0.61 0.65 0.70 0.83 0.83 0.83 0.87 1.00 1.00 1.00 0.05 0.10 0.14 0.33 0.33 0.33 0.33 0.43 0.43 0.48 0.52 0.76 0.76 0.76 0.76 0.76 0.95 0.95 0.95 0.95 1.00 0.05 0.19 0.19 0.19 0.24 0.33 0.33 0.43 0.43 0.57 0.57 0.57 0.71 0.71 0.71 0.86 0.86 0.86 1.00 1.00 1.00 0.05 0.18 0.18 0.18 0.32 0.32 0.32 0.50 0.50 0.50 0.50 0.59 0.59 0.73 0.73 0.73 0.77 0.82 0.86 1.00 1.00 1.00 0.15 0.15 0.15 0.20 0.30 0.30 0.40 0.40 0.60 0.60 0.60 0.60 0.65 0.70 0.80 0.80 0.90 0.90 1.00 1.00 0.19 0.19 0.19 0.25 0.38 0.38 0.62 0.62 0.62 0.62 0.69 0.81 0.81 0.88 1.00 1.00 0.13 0.13 0.13 0.17 0.30 0.30 0.30 0.43 0.43 0.43 0.48 0.65 0.65 0.65 0.65 0.70 0.74 0.87 0.87 0.87 1.00 1.00 1.00}
         3667  +
         3668  +do_test 1.17.8.5 {
         3669  +  set myres {}
         3670  +  foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3671  +    lappend myres [format %.2f [set r]]
         3672  +  }
         3673  +  set myres
         3674  +} {0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.27 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.39 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.49 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.59 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.81 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 0.89 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         3675  +
         3676  +do_test 1.17.8.6 {
         3677  +  set myres {}
         3678  +  foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3679  +    lappend myres [format %.2f [set r]]
         3680  +  }
         3681  +  set myres
         3682  +} {0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.41 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.61 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 0.79 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
         3683  +
         3684  +do_test 1.17.8.1 {
         3685  +  set myres {}
         3686  +  foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3687  +    lappend myres [format %.2f [set r]]
         3688  +  }
         3689  +  set myres
         3690  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 99.00 100.00 100.00}
         3691  +
         3692  +do_test 1.17.8.2 {
         3693  +  set myres {}
         3694  +  foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3695  +    lappend myres [format %.2f [set r]]
         3696  +  }
         3697  +  set myres
         3698  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         3699  +
         3700  +do_test 1.17.8.3 {
         3701  +  set myres {}
         3702  +  foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3703  +    lappend myres [format %.2f [set r]]
         3704  +  }
         3705  +  set myres
         3706  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 97.00 98.00 98.00 99.00 100.00 101.00 102.00}
         3707  +
         3708  +do_test 1.17.8.4 {
         3709  +  set myres {}
         3710  +  foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3711  +    lappend myres [format %.2f [set r]]
         3712  +  }
         3713  +  set myres
         3714  +} {1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00}
         3715  +
         3716  +do_test 1.17.8.5 {
         3717  +  set myres {}
         3718  +  foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING ) FROM t2}] {
         3719  +    lappend myres [format %.2f [set r]]
         3720  +  }
         3721  +  set myres
         3722  +} {1.00 1.00 2.00 2.00 3.00 3.00 4.00 4.00 5.00 5.00 6.00 6.00 7.00 7.00 8.00 8.00 9.00 9.00 10.00 10.00 11.00 11.00 12.00 12.00 13.00 13.00 14.00 14.00 15.00 15.00 16.00 16.00 17.00 17.00 18.00 18.00 19.00 19.00 20.00 20.00 21.00 21.00 22.00 22.00 23.00 23.00 24.00 24.00 25.00 25.00 26.00 26.00 27.00 27.00 28.00 28.00 29.00 29.00 30.00 30.00 31.00 31.00 32.00 32.00 33.00 33.00 34.00 34.00 35.00 35.00 36.00 36.00 37.00 37.00 38.00 38.00 39.00 39.00 40.00 40.00 41.00 41.00 42.00 42.00 43.00 43.00 44.00 44.00 45.00 45.00 46.00 46.00 47.00 47.00 48.00 48.00 49.00 49.00 50.00 50.00 51.00 51.00 52.00 52.00 53.00 53.00 54.00 54.00 55.00 55.00 56.00 56.00 57.00 57.00 58.00 58.00 59.00 59.00 60.00 60.00 61.00 61.00 62.00 62.00 63.00 63.00 64.00 64.00 65.00 65.00 66.00 66.00 67.00 67.00 68.00 68.00 69.00 69.00 70.00 70.00 71.00 71.00 72.00 72.00 73.00 73.00 74.00 74.00 75.00 75.00 76.00 76.00 77.00 77.00 78.00 78.00 79.00 79.00 80.00 80.00 81.00 81.00 82.00 82.00 83.00 83.00 84.00 84.00 85.00 85.00 86.00 86.00 87.00 87.00 88.00 88.00 89.00 89.00 90.00 90.00 91.00 91.00 92.00 92.00 93.00 93.00 94.00 94.00 95.00 95.00 96.00 96.00 97.00 98.00 99.00 100.00 101.00 102.00 103.00 104.00}
         3723  +
         3724  +do_test 1.17.8.6 {
         3725  +  set myres {}
         3726  +  foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING    AND UNBOUNDED FOLLOWING) FROM t2}] {
  2231   3727       lappend myres [format %.2f [set r]]
  2232   3728     }
  2233   3729     set myres
  2234         -} {0.00 0.01 1.00 0.01 1.00 0.01 2.00 0.03 2.00 0.03 2.00 0.03 3.00 0.04 3.00 0.04 4.00 0.04 5.00 0.05 6.00 0.06 7.00 0.07 7.00 0.07 7.00 0.07 8.00 0.09 8.00 0.09 8.00 0.09 9.00 0.10 9.00 0.10 9.00 0.10 10.00 0.10 11.00 0.12 11.00 0.12 12.00 0.13 12.00 0.13 12.00 0.13 13.00 0.14 13.00 0.14 14.00 0.14 15.00 0.16 15.00 0.16 15.00 0.16 16.00 0.17 16.00 0.17 16.00 0.17 17.00 0.18 19.00 0.18 20.00 0.19 21.00 0.20 21.00 0.20 22.00 0.21 22.00 0.21 23.00 0.23 23.00 0.23 23.00 0.23 24.00 0.23 25.00 0.23 26.00 0.25 26.00 0.25 26.00 0.25 27.00 0.26 27.00 0.26 28.00 0.27 29.00 0.28 29.00 0.28 29.00 0.28 30.00 0.29 30.00 0.29 30.00 0.29 31.00 0.30 31.00 0.30 32.00 0.31 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 33.00 0.34 34.00 0.35 34.00 0.35 34.00 0.35 34.00 0.35 35.00 0.36 35.00 0.36 36.00 0.39 36.00 0.39 36.00 0.39 36.00 0.39 37.00 0.40 37.00 0.40 38.00 0.41 38.00 0.41 39.00 0.42 39.00 0.42 39.00 0.42 40.00 0.42 41.00 0.44 41.00 0.44 41.00 0.44 42.00 0.45 43.00 0.46 43.00 0.46 44.00 0.47 44.00 0.47 46.00 0.47 46.00 0.47 47.00 0.49 47.00 0.49 47.00 0.49 47.00 0.49 49.00 0.50 50.00 0.51 51.00 0.51 52.00 0.52 53.00 0.52 54.00 0.53 55.00 0.54 55.00 0.54 56.00 0.55 56.00 0.55 56.00 0.55 57.00 0.56 58.00 0.57 58.00 0.57 58.00 0.57 58.00 0.57 59.00 0.59 59.00 0.59 59.00 0.59 59.00 0.59 60.00 0.60 61.00 0.61 61.00 0.61 62.00 0.62 62.00 0.62 63.00 0.62 64.00 0.63 65.00 0.65 65.00 0.65 65.00 0.65 66.00 0.65 67.00 0.66 68.00 0.66 69.00 0.67 70.00 0.67 72.00 0.69 72.00 0.69 72.00 0.69 73.00 0.70 73.00 0.70 73.00 0.70 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 74.00 0.72 75.00 0.74 75.00 0.74 75.00 0.74 76.00 0.74 77.00 0.76 77.00 0.76 78.00 0.77 78.00 0.77 79.00 0.77 80.00 0.78 80.00 0.78 81.00 0.80 81.00 0.80 81.00 0.80 82.00 0.80 83.00 0.81 84.00 0.82 84.00 0.82 84.00 0.82 84.00 0.82 85.00 0.84 85.00 0.84 85.00 0.84 86.00 0.84 87.00 0.85 87.00 0.85 88.00 0.86 89.00 0.88 89.00 0.88 89.00 0.88 90.00 0.89 90.00 0.89 90.00 0.89 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 91.00 0.92 93.00 0.93 93.00 0.93 93.00 0.93 94.00 0.94 95.00 0.95 95.00 0.95 95.00 0.95 96.00 0.96 96.00 0.96 96.00 0.96 97.00 0.97 97.00 0.97 98.00 0.98 98.00 0.98 99.00 1.00 99.00 1.00 99.00 1.00}
         3730  +} {1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00}
  2235   3731   
  2236   3732   finish_test

Added test/window4.tcl.

            1  +# 2018 May 19
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +#
           12  +
           13  +source [file join [file dirname $argv0] pg_common.tcl]
           14  +
           15  +#=========================================================================
           16  +
           17  +start_test window4 "2018 June 04"
           18  +
           19  +execsql_test 1.0 {
           20  +  DROP TABLE IF EXISTS t3;
           21  +  CREATE TABLE t3(a TEXT PRIMARY KEY);
           22  +  INSERT INTO t3 VALUES('a'), ('b'), ('c'), ('d'), ('e');
           23  +  INSERT INTO t3 VALUES('f'), ('g'), ('h'), ('i'), ('j');
           24  +}
           25  +
           26  +for {set i 1} {$i < 20} {incr i} {
           27  +  execsql_test 1.$i "SELECT a, ntile($i) OVER (ORDER BY a) FROM t3"
           28  +}
           29  +
           30  +finish_test

Added test/window4.test.

            1  +# 2018 June 04
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.
           12  +#
           13  +
           14  +####################################################
           15  +# DO NOT EDIT! THIS FILE IS AUTOMATICALLY GENERATED!
           16  +####################################################
           17  +
           18  +set testdir [file dirname $argv0]
           19  +source $testdir/tester.tcl
           20  +set testprefix window4
           21  +
           22  +do_execsql_test 1.0 {
           23  +  DROP TABLE IF EXISTS t3;
           24  +  CREATE TABLE t3(a TEXT PRIMARY KEY);
           25  +  INSERT INTO t3 VALUES('a'), ('b'), ('c'), ('d'), ('e');
           26  +  INSERT INTO t3 VALUES('f'), ('g'), ('h'), ('i'), ('j');
           27  +} {}
           28  +
           29  +do_execsql_test 1.1 {
           30  +  SELECT a, ntile(1) OVER (ORDER BY a) FROM t3
           31  +} {a 1   b 1   c 1   d 1   e 1   f 1   g 1   h 1   i 1   j 1}
           32  +
           33  +do_execsql_test 1.2 {
           34  +  SELECT a, ntile(2) OVER (ORDER BY a) FROM t3
           35  +} {a 1   b 1   c 1   d 1   e 1   f 2   g 2   h 2   i 2   j 2}
           36  +
           37  +do_execsql_test 1.3 {
           38  +  SELECT a, ntile(3) OVER (ORDER BY a) FROM t3
           39  +} {a 1   b 1   c 1   d 1   e 2   f 2   g 2   h 3   i 3   j 3}
           40  +
           41  +do_execsql_test 1.4 {
           42  +  SELECT a, ntile(4) OVER (ORDER BY a) FROM t3
           43  +} {a 1   b 1   c 1   d 2   e 2   f 2   g 3   h 3   i 4   j 4}
           44  +
           45  +do_execsql_test 1.5 {
           46  +  SELECT a, ntile(5) OVER (ORDER BY a) FROM t3
           47  +} {a 1   b 1   c 2   d 2   e 3   f 3   g 4   h 4   i 5   j 5}
           48  +
           49  +do_execsql_test 1.6 {
           50  +  SELECT a, ntile(6) OVER (ORDER BY a) FROM t3
           51  +} {a 1   b 1   c 2   d 2   e 3   f 3   g 4   h 4   i 5   j 6}
           52  +
           53  +do_execsql_test 1.7 {
           54  +  SELECT a, ntile(7) OVER (ORDER BY a) FROM t3
           55  +} {a 1   b 1   c 2   d 2   e 3   f 3   g 4   h 5   i 6   j 7}
           56  +
           57  +do_execsql_test 1.8 {
           58  +  SELECT a, ntile(8) OVER (ORDER BY a) FROM t3
           59  +} {a 1   b 1   c 2   d 2   e 3   f 4   g 5   h 6   i 7   j 8}
           60  +
           61  +do_execsql_test 1.9 {
           62  +  SELECT a, ntile(9) OVER (ORDER BY a) FROM t3
           63  +} {a 1   b 1   c 2   d 3   e 4   f 5   g 6   h 7   i 8   j 9}
           64  +
           65  +do_execsql_test 1.10 {
           66  +  SELECT a, ntile(10) OVER (ORDER BY a) FROM t3
           67  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
           68  +
           69  +do_execsql_test 1.11 {
           70  +  SELECT a, ntile(11) OVER (ORDER BY a) FROM t3
           71  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
           72  +
           73  +do_execsql_test 1.12 {
           74  +  SELECT a, ntile(12) OVER (ORDER BY a) FROM t3
           75  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
           76  +
           77  +do_execsql_test 1.13 {
           78  +  SELECT a, ntile(13) OVER (ORDER BY a) FROM t3
           79  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
           80  +
           81  +do_execsql_test 1.14 {
           82  +  SELECT a, ntile(14) OVER (ORDER BY a) FROM t3
           83  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
           84  +
           85  +do_execsql_test 1.15 {
           86  +  SELECT a, ntile(15) OVER (ORDER BY a) FROM t3
           87  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
           88  +
           89  +do_execsql_test 1.16 {
           90  +  SELECT a, ntile(16) OVER (ORDER BY a) FROM t3
           91  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
           92  +
           93  +do_execsql_test 1.17 {
           94  +  SELECT a, ntile(17) OVER (ORDER BY a) FROM t3
           95  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
           96  +
           97  +do_execsql_test 1.18 {
           98  +  SELECT a, ntile(18) OVER (ORDER BY a) FROM t3
           99  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
          100  +
          101  +do_execsql_test 1.19 {
          102  +  SELECT a, ntile(19) OVER (ORDER BY a) FROM t3
          103  +} {a 1   b 2   c 3   d 4   e 5   f 6   g 7   h 8   i 9   j 10}
          104  +
          105  +finish_test