3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library.
14 ####################################################
15 # DO NOT EDIT! THIS FILE IS AUTOMATICALLY GENERATED!
16 ####################################################
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
20 set testprefix window8
22 ifcapable !windowfunc { finish_test ; return }
24 DROP TABLE IF EXISTS t3;
25 CREATE TABLE t3(a TEXT, b TEXT, c INTEGER);
27 ('HH', 'bb', 355), ('CC', 'aa', 158), ('BB', 'aa', 399),
28 ('FF', 'bb', 938), ('HH', 'aa', 480), ('FF', 'bb', 870),
29 ('JJ', 'aa', 768), ('JJ', 'aa', 899), ('GG', 'bb', 929),
30 ('II', 'bb', 421), ('GG', 'bb', 844), ('FF', 'bb', 574),
31 ('CC', 'bb', 822), ('GG', 'bb', 938), ('BB', 'aa', 660),
32 ('HH', 'aa', 979), ('BB', 'bb', 792), ('DD', 'aa', 845),
33 ('JJ', 'bb', 354), ('FF', 'bb', 295), ('JJ', 'aa', 234),
34 ('BB', 'bb', 840), ('AA', 'aa', 934), ('EE', 'aa', 113),
35 ('AA', 'bb', 309), ('BB', 'aa', 412), ('AA', 'aa', 911),
36 ('AA', 'bb', 572), ('II', 'aa', 398), ('II', 'bb', 250),
37 ('II', 'aa', 652), ('BB', 'bb', 633), ('AA', 'aa', 239),
38 ('FF', 'aa', 670), ('BB', 'bb', 705), ('HH', 'bb', 963),
39 ('CC', 'bb', 346), ('II', 'bb', 671), ('BB', 'aa', 247),
40 ('AA', 'aa', 223), ('GG', 'aa', 480), ('HH', 'aa', 790),
41 ('FF', 'aa', 208), ('BB', 'bb', 711), ('EE', 'aa', 777),
42 ('DD', 'bb', 716), ('CC', 'aa', 759), ('CC', 'aa', 430),
43 ('CC', 'aa', 607), ('DD', 'bb', 794), ('GG', 'aa', 148),
44 ('GG', 'aa', 634), ('JJ', 'bb', 257), ('DD', 'bb', 959),
45 ('FF', 'bb', 726), ('BB', 'aa', 762), ('JJ', 'bb', 336),
46 ('GG', 'aa', 335), ('HH', 'bb', 330), ('GG', 'bb', 160),
47 ('JJ', 'bb', 839), ('FF', 'aa', 618), ('BB', 'aa', 393),
48 ('EE', 'bb', 629), ('FF', 'aa', 667), ('AA', 'bb', 870),
49 ('FF', 'bb', 102), ('JJ', 'aa', 113), ('DD', 'aa', 224),
50 ('AA', 'bb', 627), ('HH', 'bb', 730), ('II', 'bb', 443),
51 ('HH', 'bb', 133), ('EE', 'bb', 252), ('II', 'bb', 805),
52 ('BB', 'bb', 786), ('EE', 'bb', 768), ('HH', 'bb', 683),
53 ('DD', 'bb', 238), ('DD', 'aa', 256);
56 do_execsql_test 1.1.1 {
57 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
58 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
59 AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
60 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685
61 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025
62 CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147
63 DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 19179
64 EE aa 19179 EE bb 19179 EE bb 19179 EE bb 19179 FF aa 21718
65 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 21718 FF bb 21718
66 FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 GG aa 27386
67 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 27386 GG bb 27386
68 GG bb 27386 GG bb 27386 HH aa 31854 HH aa 31854 HH aa 31854
69 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854
70 HH bb 31854 II aa 37297 II aa 37297 II bb 37297 II bb 37297
71 II bb 37297 II bb 37297 II bb 37297 JJ aa 40937 JJ aa 40937
72 JJ aa 40937 JJ aa 40937 JJ bb 40937 JJ bb 40937 JJ bb 40937
75 do_execsql_test 1.1.2 {
76 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
77 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307
78 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
79 BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558
80 BB bb 7558 BB bb 7558 CC aa 12025 CC aa 12025 CC aa 12025
81 CC aa 12025 CC bb 13979 CC bb 13979 DD aa 15147 DD aa 15147
82 DD aa 15147 DD bb 16472 DD bb 16472 DD bb 16472 DD bb 16472
83 EE aa 19179 EE aa 19179 EE bb 20069 EE bb 20069 EE bb 20069
84 FF aa 21718 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 23881
85 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881
86 GG aa 27386 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 28983
87 GG bb 28983 GG bb 28983 GG bb 28983 HH aa 31854 HH aa 31854
88 HH aa 31854 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103
89 HH bb 34103 HH bb 34103 II aa 37297 II aa 37297 II bb 38347
90 II bb 38347 II bb 38347 II bb 38347 II bb 38347 JJ aa 40937
91 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ bb 42951 JJ bb 42951
92 JJ bb 42951 JJ bb 42951}
94 do_execsql_test 1.1.3 {
95 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
96 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
97 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
98 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
99 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
100 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
101 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
102 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
103 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
104 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
105 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
106 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
107 JJ bb 73 JJ bb 73 JJ bb 73}
109 do_execsql_test 1.1.4 {
110 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
111 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934
112 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934
113 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934
114 BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934
115 CC bb 934 CC bb 934 DD aa 934 DD aa 934 DD aa 934 DD bb 934
116 DD bb 934 DD bb 934 DD bb 934 EE aa 959 EE aa 959 EE bb 959
117 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959
118 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959
119 GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 959 GG bb 959
120 GG bb 959 GG bb 959 HH aa 959 HH aa 959 HH aa 959 HH bb 979
121 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
122 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979
123 JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979
126 do_execsql_test 1.1.5 {
127 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
128 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223
129 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223
130 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223
131 BB bb 223 BB bb 223 CC aa 223 CC aa 223 CC aa 223 CC aa 223
132 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158
133 DD bb 158 DD bb 158 DD bb 158 EE aa 158 EE aa 158 EE bb 113
134 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113
135 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113
136 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
137 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102
138 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102
139 II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102
140 JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102
143 do_execsql_test 1.1.6 {
144 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
145 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
146 AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
147 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685
148 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025
149 CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147
150 DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 19179
151 EE aa 19179 EE bb 19179 EE bb 19179 EE bb 19179 FF aa 21718
152 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 21718 FF bb 21718
153 FF bb 21718 FF bb 21718 FF bb 21718 FF bb 21718 GG aa 27386
154 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 27386 GG bb 27386
155 GG bb 27386 GG bb 27386 HH aa 31854 HH aa 31854 HH aa 31854
156 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854 HH bb 31854
157 HH bb 31854 II aa 37297 II aa 37297 II bb 37297 II bb 37297
158 II bb 37297 II bb 37297 II bb 37297 JJ aa 40937 JJ aa 40937
159 JJ aa 40937 JJ aa 40937 JJ bb 40937 JJ bb 40937 JJ bb 40937
162 do_execsql_test 1.1.7 {
163 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
164 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307
165 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
166 BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558
167 BB bb 7558 BB bb 7558 CC aa 12025 CC aa 12025 CC aa 12025
168 CC aa 12025 CC bb 13979 CC bb 13979 DD aa 15147 DD aa 15147
169 DD aa 15147 DD bb 16472 DD bb 16472 DD bb 16472 DD bb 16472
170 EE aa 19179 EE aa 19179 EE bb 20069 EE bb 20069 EE bb 20069
171 FF aa 21718 FF aa 21718 FF aa 21718 FF aa 21718 FF bb 23881
172 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881 FF bb 23881
173 GG aa 27386 GG aa 27386 GG aa 27386 GG aa 27386 GG bb 28983
174 GG bb 28983 GG bb 28983 GG bb 28983 HH aa 31854 HH aa 31854
175 HH aa 31854 HH bb 34103 HH bb 34103 HH bb 34103 HH bb 34103
176 HH bb 34103 HH bb 34103 II aa 37297 II aa 37297 II bb 38347
177 II bb 38347 II bb 38347 II bb 38347 II bb 38347 JJ aa 40937
178 JJ aa 40937 JJ aa 40937 JJ aa 40937 JJ bb 42951 JJ bb 42951
179 JJ bb 42951 JJ bb 42951}
181 do_execsql_test 1.1.8 {
183 sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW),
184 sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING ),
185 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW),
186 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING )
187 FROM t3 ORDER BY 1, 2, 3;
188 } {AA aa {} {} {} {} AA aa {} {} {} {} AA aa {} {} {} {}
189 AA aa {} {} {} {} AA bb {} {} 2307 2307 AA bb {} {} 2307 2307
190 AA bb {} {} 2307 2307 AA bb {} {} 2307 2307 BB aa 4685 4685 4685 4685
191 BB aa 4685 4685 4685 4685 BB aa 4685 4685 4685 4685
192 BB aa 4685 4685 4685 4685 BB aa 4685 4685 4685 4685
193 BB aa 4685 4685 4685 4685 BB bb 4685 4685 7558 7558
194 BB bb 4685 4685 7558 7558 BB bb 4685 4685 7558 7558
195 BB bb 4685 4685 7558 7558 BB bb 4685 4685 7558 7558
196 BB bb 4685 4685 7558 7558 CC aa 12025 12025 12025 12025
197 CC aa 12025 12025 12025 12025 CC aa 12025 12025 12025 12025
198 CC aa 12025 12025 12025 12025 CC bb 12025 12025 13979 13979
199 CC bb 12025 12025 13979 13979 DD aa 15147 15147 15147 15147
200 DD aa 15147 15147 15147 15147 DD aa 15147 15147 15147 15147
201 DD bb 15147 15147 16472 16472 DD bb 15147 15147 16472 16472
202 DD bb 15147 15147 16472 16472 DD bb 15147 15147 16472 16472
203 EE aa 19179 19179 19179 19179 EE aa 19179 19179 19179 19179
204 EE bb 19179 19179 20069 20069 EE bb 19179 19179 20069 20069
205 EE bb 19179 19179 20069 20069 FF aa 21718 21718 21718 21718
206 FF aa 21718 21718 21718 21718 FF aa 21718 21718 21718 21718
207 FF aa 21718 21718 21718 21718 FF bb 21718 21718 23881 23881
208 FF bb 21718 21718 23881 23881 FF bb 21718 21718 23881 23881
209 FF bb 21718 21718 23881 23881 FF bb 21718 21718 23881 23881
210 FF bb 21718 21718 23881 23881 GG aa 27386 27386 27386 27386
211 GG aa 27386 27386 27386 27386 GG aa 27386 27386 27386 27386
212 GG aa 27386 27386 27386 27386 GG bb 27386 27386 28983 28983
213 GG bb 27386 27386 28983 28983 GG bb 27386 27386 28983 28983
214 GG bb 27386 27386 28983 28983 HH aa 31854 31854 31854 31854
215 HH aa 31854 31854 31854 31854 HH aa 31854 31854 31854 31854
216 HH bb 31854 31854 34103 34103 HH bb 31854 31854 34103 34103
217 HH bb 31854 31854 34103 34103 HH bb 31854 31854 34103 34103
218 HH bb 31854 31854 34103 34103 HH bb 31854 31854 34103 34103
219 II aa 37297 37297 37297 37297 II aa 37297 37297 37297 37297
220 II bb 37297 37297 38347 38347 II bb 37297 37297 38347 38347
221 II bb 37297 37297 38347 38347 II bb 37297 37297 38347 38347
222 II bb 37297 37297 38347 38347 JJ aa 40937 40937 40937 40937
223 JJ aa 40937 40937 40937 40937 JJ aa 40937 40937 40937 40937
224 JJ aa 40937 40937 40937 40937 JJ bb 40937 40937 42951 42951
225 JJ bb 40937 40937 42951 42951 JJ bb 40937 40937 42951 42951
226 JJ bb 40937 40937 42951 42951}
228 do_execsql_test 1.2.1 {
229 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
230 } {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685
231 AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025
232 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025
233 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147
234 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147
235 DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179
236 DD bb 19179 DD bb 19179 EE aa 21718 EE aa 21718 EE bb 21718
237 EE bb 21718 EE bb 21718 FF aa 27386 FF aa 27386 FF aa 27386
238 FF aa 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386
239 FF bb 27386 FF bb 27386 GG aa 31854 GG aa 31854 GG aa 31854
240 GG aa 31854 GG bb 31854 GG bb 31854 GG bb 31854 GG bb 31854
241 HH aa 37297 HH aa 37297 HH aa 37297 HH bb 37297 HH bb 37297
242 HH bb 37297 HH bb 37297 HH bb 37297 HH bb 37297 II aa 40937
243 II aa 40937 II bb 40937 II bb 40937 II bb 40937 II bb 40937
244 II bb 40937 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737
245 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737}
247 do_execsql_test 1.2.2 {
248 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
249 } {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685
250 AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558
251 BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025
252 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 13979 CC aa 13979
253 CC aa 13979 CC aa 13979 CC bb 15147 CC bb 15147 DD aa 16472
254 DD aa 16472 DD aa 16472 DD bb 19179 DD bb 19179 DD bb 19179
255 DD bb 19179 EE aa 20069 EE aa 20069 EE bb 21718 EE bb 21718
256 EE bb 21718 FF aa 23881 FF aa 23881 FF aa 23881 FF aa 23881
257 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386 FF bb 27386
258 FF bb 27386 GG aa 28983 GG aa 28983 GG aa 28983 GG aa 28983
259 GG bb 31854 GG bb 31854 GG bb 31854 GG bb 31854 HH aa 34103
260 HH aa 34103 HH aa 34103 HH bb 37297 HH bb 37297 HH bb 37297
261 HH bb 37297 HH bb 37297 HH bb 37297 II aa 38347 II aa 38347
262 II bb 40937 II bb 40937 II bb 40937 II bb 40937 II bb 40937
263 JJ aa 42951 JJ aa 42951 JJ aa 42951 JJ aa 42951 JJ bb 44737
264 JJ bb 44737 JJ bb 44737 JJ bb 44737}
266 do_execsql_test 1.2.3 {
267 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
268 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
269 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
270 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
271 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
272 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
273 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
274 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
275 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
276 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
277 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
278 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
279 JJ bb 73 JJ bb 73 JJ bb 73}
281 do_execsql_test 1.2.4 {
282 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
283 } {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934
284 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934
285 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934
286 BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934
287 CC bb 934 CC bb 934 DD aa 934 DD aa 934 DD aa 934 DD bb 959
288 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959
289 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959
290 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959
291 GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 959 GG bb 959
292 GG bb 959 GG bb 959 HH aa 979 HH aa 979 HH aa 979 HH bb 979
293 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
294 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979
295 JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979
298 do_execsql_test 1.2.5 {
299 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
300 } {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223
301 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223
302 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223
303 BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158
304 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158
305 DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113
306 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113
307 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
308 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
309 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102
310 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102
311 II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102
312 JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102
315 do_execsql_test 1.2.6 {
316 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
317 } {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058
318 AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613
319 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233
320 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388
321 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801
322 DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385
323 DD bb 18463 DD bb 18941 EE aa 20941 EE aa 21605 EE bb 20950
324 EE bb 21089 EE bb 21466 FF aa 26716 FF aa 26719 FF aa 26768
325 FF aa 27178 FF bb 26448 FF bb 26516 FF bb 26660 FF bb 26812
326 FF bb 27091 FF bb 27284 GG aa 31220 GG aa 31374 GG aa 31519
327 GG aa 31706 GG bb 30916 GG bb 30925 GG bb 31010 GG bb 31694
328 HH aa 36318 HH aa 36507 HH aa 36817 HH bb 36334 HH bb 36567
329 HH bb 36614 HH bb 36942 HH bb 36967 HH bb 37164 II aa 40285
330 II aa 40539 II bb 40132 II bb 40266 II bb 40494 II bb 40516
331 II bb 40687 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624
332 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480}
334 do_execsql_test 1.2.7 {
335 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
336 } {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058
337 AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159
338 BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239
339 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 13220 CC aa 13372
340 CC aa 13549 CC aa 13821 CC bb 14325 CC bb 14801 DD aa 15627
341 DD aa 16216 DD aa 16248 DD bb 18220 DD bb 18385 DD bb 18463
342 DD bb 18941 EE aa 19292 EE aa 19956 EE bb 20950 EE bb 21089
343 EE bb 21466 FF aa 23211 FF aa 23214 FF aa 23263 FF aa 23673
344 FF bb 26448 FF bb 26516 FF bb 26660 FF bb 26812 FF bb 27091
345 FF bb 27284 GG aa 28349 GG aa 28503 GG aa 28648 GG aa 28835
346 GG bb 30916 GG bb 30925 GG bb 31010 GG bb 31694 HH aa 33124
347 HH aa 33313 HH aa 33623 HH bb 36334 HH bb 36567 HH bb 36614
348 HH bb 36942 HH bb 36967 HH bb 37164 II aa 37695 II aa 37949
349 II bb 40132 II bb 40266 II bb 40494 II bb 40516 II bb 40687
350 JJ aa 42052 JJ aa 42183 JJ aa 42717 JJ aa 42838 JJ bb 43898
351 JJ bb 44383 JJ bb 44401 JJ bb 44480}
353 do_execsql_test 1.2.8 {
355 sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW),
356 sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ),
357 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW),
358 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW )
359 FROM t3 ORDER BY 1, 2, 3;
360 } {AA aa 3751 4685 1373 2307 AA aa 3774 4685 1396 2307
361 AA aa 4446 4685 2068 2307 AA aa 4462 4685 2084 2307
362 AA bb 3815 4685 3815 4685 AA bb 4058 4685 4058 4685
363 AA bb 4113 4685 4113 4685 AA bb 4376 4685 4376 4685
364 BB aa 11263 12025 6796 7558 BB aa 11365 12025 6898 7558
365 BB aa 11613 12025 7146 7558 BB aa 11626 12025 7159 7558
366 BB aa 11632 12025 7165 7558 BB aa 11778 12025 7311 7558
367 BB bb 11185 12025 11185 12025 BB bb 11233 12025 11233 12025
368 BB bb 11239 12025 11239 12025 BB bb 11314 12025 11314 12025
369 BB bb 11320 12025 11320 12025 BB bb 11392 12025 11392 12025
370 CC aa 14388 15147 13220 13979 CC aa 14540 15147 13372 13979
371 CC aa 14717 15147 13549 13979 CC aa 14989 15147 13821 13979
372 CC bb 14325 15147 14325 15147 CC bb 14801 15147 14801 15147
373 DD aa 18334 19179 15627 16472 DD aa 18923 19179 16216 16472
374 DD aa 18955 19179 16248 16472 DD bb 18220 19179 18220 19179
375 DD bb 18385 19179 18385 19179 DD bb 18463 19179 18463 19179
376 DD bb 18941 19179 18941 19179 EE aa 20941 21718 19292 20069
377 EE aa 21605 21718 19956 20069 EE bb 20950 21718 20950 21718
378 EE bb 21089 21718 21089 21718 EE bb 21466 21718 21466 21718
379 FF aa 26716 27386 23211 23881 FF aa 26719 27386 23214 23881
380 FF aa 26768 27386 23263 23881 FF aa 27178 27386 23673 23881
381 FF bb 26448 27386 26448 27386 FF bb 26516 27386 26516 27386
382 FF bb 26660 27386 26660 27386 FF bb 26812 27386 26812 27386
383 FF bb 27091 27386 27091 27386 FF bb 27284 27386 27284 27386
384 GG aa 31220 31854 28349 28983 GG aa 31374 31854 28503 28983
385 GG aa 31519 31854 28648 28983 GG aa 31706 31854 28835 28983
386 GG bb 30916 31854 30916 31854 GG bb 30925 31854 30925 31854
387 GG bb 31010 31854 31010 31854 GG bb 31694 31854 31694 31854
388 HH aa 36318 37297 33124 34103 HH aa 36507 37297 33313 34103
389 HH aa 36817 37297 33623 34103 HH bb 36334 37297 36334 37297
390 HH bb 36567 37297 36567 37297 HH bb 36614 37297 36614 37297
391 HH bb 36942 37297 36942 37297 HH bb 36967 37297 36967 37297
392 HH bb 37164 37297 37164 37297 II aa 40285 40937 37695 38347
393 II aa 40539 40937 37949 38347 II bb 40132 40937 40132 40937
394 II bb 40266 40937 40266 40937 II bb 40494 40937 40494 40937
395 II bb 40516 40937 40516 40937 II bb 40687 40937 40687 40937
396 JJ aa 43838 44737 42052 42951 JJ aa 43969 44737 42183 42951
397 JJ aa 44503 44737 42717 42951 JJ aa 44624 44737 42838 42951
398 JJ bb 43898 44737 43898 44737 JJ bb 44383 44737 44383 44737
399 JJ bb 44401 44737 44401 44737 JJ bb 44480 44737 44480 44737}
401 do_execsql_test 1.3.1 {
402 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
403 } {AA aa 12025 AA aa 12025 AA aa 12025 AA aa 12025 AA bb 12025
404 AA bb 12025 AA bb 12025 AA bb 12025 BB aa 15147 BB aa 15147
405 BB aa 15147 BB aa 15147 BB aa 15147 BB aa 15147 BB bb 15147
406 BB bb 15147 BB bb 15147 BB bb 15147 BB bb 15147 BB bb 15147
407 CC aa 19179 CC aa 19179 CC aa 19179 CC aa 19179 CC bb 19179
408 CC bb 19179 DD aa 21718 DD aa 21718 DD aa 21718 DD bb 21718
409 DD bb 21718 DD bb 21718 DD bb 21718 EE aa 27386 EE aa 27386
410 EE bb 27386 EE bb 27386 EE bb 27386 FF aa 31854 FF aa 31854
411 FF aa 31854 FF aa 31854 FF bb 31854 FF bb 31854 FF bb 31854
412 FF bb 31854 FF bb 31854 FF bb 31854 GG aa 37297 GG aa 37297
413 GG aa 37297 GG aa 37297 GG bb 37297 GG bb 37297 GG bb 37297
414 GG bb 37297 HH aa 40937 HH aa 40937 HH aa 40937 HH bb 40937
415 HH bb 40937 HH bb 40937 HH bb 40937 HH bb 40937 HH bb 40937
416 II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737
417 II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737
418 JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737}
420 do_execsql_test 1.3.2 {
421 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
422 } {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 7558 AA bb 7558
423 AA bb 7558 AA bb 7558 BB aa 12025 BB aa 12025 BB aa 12025
424 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 13979 BB bb 13979
425 BB bb 13979 BB bb 13979 BB bb 13979 BB bb 13979 CC aa 15147
426 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 16472 CC bb 16472
427 DD aa 19179 DD aa 19179 DD aa 19179 DD bb 20069 DD bb 20069
428 DD bb 20069 DD bb 20069 EE aa 21718 EE aa 21718 EE bb 23881
429 EE bb 23881 EE bb 23881 FF aa 27386 FF aa 27386 FF aa 27386
430 FF aa 27386 FF bb 28983 FF bb 28983 FF bb 28983 FF bb 28983
431 FF bb 28983 FF bb 28983 GG aa 31854 GG aa 31854 GG aa 31854
432 GG aa 31854 GG bb 34103 GG bb 34103 GG bb 34103 GG bb 34103
433 HH aa 37297 HH aa 37297 HH aa 37297 HH bb 38347 HH bb 38347
434 HH bb 38347 HH bb 38347 HH bb 38347 HH bb 38347 II aa 40937
435 II aa 40937 II bb 42951 II bb 42951 II bb 42951 II bb 42951
436 II bb 42951 JJ aa 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737
437 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737}
439 do_execsql_test 1.3.3 {
440 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
441 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
442 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
443 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
444 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
445 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
446 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
447 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
448 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
449 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
450 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
451 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
452 JJ bb 73 JJ bb 73 JJ bb 73}
454 do_execsql_test 1.3.4 {
455 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
456 } {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934
457 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934
458 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934
459 BB bb 934 BB bb 934 CC aa 934 CC aa 934 CC aa 934 CC aa 934
460 CC bb 934 CC bb 934 DD aa 959 DD aa 959 DD aa 959 DD bb 959
461 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959
462 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959
463 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959 FF bb 959
464 GG aa 959 GG aa 959 GG aa 959 GG aa 959 GG bb 979 GG bb 979
465 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979
466 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
467 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979
468 JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979
471 do_execsql_test 1.3.5 {
472 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
473 } {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223
474 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223
475 BB aa 223 BB aa 223 BB bb 158 BB bb 158 BB bb 158 BB bb 158
476 BB bb 158 BB bb 158 CC aa 158 CC aa 158 CC aa 158 CC aa 158
477 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 113
478 DD bb 113 DD bb 113 DD bb 113 EE aa 113 EE aa 113 EE bb 113
479 EE bb 113 EE bb 113 FF aa 102 FF aa 102 FF aa 102 FF aa 102
480 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
481 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
482 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102
483 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102
484 II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102
485 JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102
488 do_execsql_test 1.3.6 {
489 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
490 } {AA aa 11091 AA aa 11114 AA aa 11786 AA aa 11802 AA bb 11155
491 AA bb 11398 AA bb 11453 AA bb 11716 BB aa 14385 BB aa 14487
492 BB aa 14735 BB aa 14748 BB aa 14754 BB aa 14900 BB bb 14307
493 BB bb 14355 BB bb 14361 BB bb 14436 BB bb 14442 BB bb 14514
494 CC aa 18420 CC aa 18572 CC aa 18749 CC aa 19021 CC bb 18357
495 CC bb 18833 DD aa 20873 DD aa 21462 DD aa 21494 DD bb 20759
496 DD bb 20924 DD bb 21002 DD bb 21480 EE aa 26609 EE aa 27273
497 EE bb 26618 EE bb 26757 EE bb 27134 FF aa 31184 FF aa 31187
498 FF aa 31236 FF aa 31646 FF bb 30916 FF bb 30984 FF bb 31128
499 FF bb 31280 FF bb 31559 FF bb 31752 GG aa 36663 GG aa 36817
500 GG aa 36962 GG aa 37149 GG bb 36359 GG bb 36368 GG bb 36453
501 GG bb 37137 HH aa 39958 HH aa 40147 HH aa 40457 HH bb 39974
502 HH bb 40207 HH bb 40254 HH bb 40582 HH bb 40607 HH bb 40804
503 II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294
504 II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503
505 JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480}
507 do_execsql_test 1.3.7 {
508 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
509 } {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 6688 AA bb 6931
510 AA bb 6986 AA bb 7249 BB aa 11263 BB aa 11365 BB aa 11613
511 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 13139 BB bb 13187
512 BB bb 13193 BB bb 13268 BB bb 13274 BB bb 13346 CC aa 14388
513 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 15650 CC bb 16126
514 DD aa 18334 DD aa 18923 DD aa 18955 DD bb 19110 DD bb 19275
515 DD bb 19353 DD bb 19831 EE aa 20941 EE aa 21605 EE bb 23113
516 EE bb 23252 EE bb 23629 FF aa 26716 FF aa 26719 FF aa 26768
517 FF aa 27178 FF bb 28045 FF bb 28113 FF bb 28257 FF bb 28409
518 FF bb 28688 FF bb 28881 GG aa 31220 GG aa 31374 GG aa 31519
519 GG aa 31706 GG bb 33165 GG bb 33174 GG bb 33259 GG bb 33943
520 HH aa 36318 HH aa 36507 HH aa 36817 HH bb 37384 HH bb 37617
521 HH bb 37664 HH bb 37992 HH bb 38017 HH bb 38214 II aa 40285
522 II aa 40539 II bb 42146 II bb 42280 II bb 42508 II bb 42530
523 II bb 42701 JJ aa 43838 JJ aa 43969 JJ aa 44503 JJ aa 44624
524 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480}
526 do_execsql_test 1.3.8 {
528 sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW),
529 sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING ),
530 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING EXCLUDE CURRENT ROW),
531 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING )
532 FROM t3 ORDER BY 1, 2, 3;
533 } {AA aa 11091 12025 3751 4685 AA aa 11114 12025 3774 4685
534 AA aa 11786 12025 4446 4685 AA aa 11802 12025 4462 4685
535 AA bb 11155 12025 6688 7558 AA bb 11398 12025 6931 7558
536 AA bb 11453 12025 6986 7558 AA bb 11716 12025 7249 7558
537 BB aa 14385 15147 11263 12025 BB aa 14487 15147 11365 12025
538 BB aa 14735 15147 11613 12025 BB aa 14748 15147 11626 12025
539 BB aa 14754 15147 11632 12025 BB aa 14900 15147 11778 12025
540 BB bb 14307 15147 13139 13979 BB bb 14355 15147 13187 13979
541 BB bb 14361 15147 13193 13979 BB bb 14436 15147 13268 13979
542 BB bb 14442 15147 13274 13979 BB bb 14514 15147 13346 13979
543 CC aa 18420 19179 14388 15147 CC aa 18572 19179 14540 15147
544 CC aa 18749 19179 14717 15147 CC aa 19021 19179 14989 15147
545 CC bb 18357 19179 15650 16472 CC bb 18833 19179 16126 16472
546 DD aa 20873 21718 18334 19179 DD aa 21462 21718 18923 19179
547 DD aa 21494 21718 18955 19179 DD bb 20759 21718 19110 20069
548 DD bb 20924 21718 19275 20069 DD bb 21002 21718 19353 20069
549 DD bb 21480 21718 19831 20069 EE aa 26609 27386 20941 21718
550 EE aa 27273 27386 21605 21718 EE bb 26618 27386 23113 23881
551 EE bb 26757 27386 23252 23881 EE bb 27134 27386 23629 23881
552 FF aa 31184 31854 26716 27386 FF aa 31187 31854 26719 27386
553 FF aa 31236 31854 26768 27386 FF aa 31646 31854 27178 27386
554 FF bb 30916 31854 28045 28983 FF bb 30984 31854 28113 28983
555 FF bb 31128 31854 28257 28983 FF bb 31280 31854 28409 28983
556 FF bb 31559 31854 28688 28983 FF bb 31752 31854 28881 28983
557 GG aa 36663 37297 31220 31854 GG aa 36817 37297 31374 31854
558 GG aa 36962 37297 31519 31854 GG aa 37149 37297 31706 31854
559 GG bb 36359 37297 33165 34103 GG bb 36368 37297 33174 34103
560 GG bb 36453 37297 33259 34103 GG bb 37137 37297 33943 34103
561 HH aa 39958 40937 36318 37297 HH aa 40147 40937 36507 37297
562 HH aa 40457 40937 36817 37297 HH bb 39974 40937 37384 38347
563 HH bb 40207 40937 37617 38347 HH bb 40254 40937 37664 38347
564 HH bb 40582 40937 37992 38347 HH bb 40607 40937 38017 38347
565 HH bb 40804 40937 38214 38347 II aa 44085 44737 40285 40937
566 II aa 44339 44737 40539 40937 II bb 43932 44737 42146 42951
567 II bb 44066 44737 42280 42951 II bb 44294 44737 42508 42951
568 II bb 44316 44737 42530 42951 II bb 44487 44737 42701 42951
569 JJ aa 43838 44737 43838 44737 JJ aa 43969 44737 43969 44737
570 JJ aa 44503 44737 44503 44737 JJ aa 44624 44737 44624 44737
571 JJ bb 43898 44737 43898 44737 JJ bb 44383 44737 44383 44737
572 JJ bb 44401 44737 44401 44737 JJ bb 44480 44737 44480 44737}
574 do_execsql_test 1.4.1 {
575 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
576 } {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737
577 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737
578 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737
579 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737
580 CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737
581 CC bb 44737 DD aa 44737 DD aa 44737 DD aa 44737 DD bb 44737
582 DD bb 44737 DD bb 44737 DD bb 44737 EE aa 44737 EE aa 44737
583 EE bb 44737 EE bb 44737 EE bb 44737 FF aa 44737 FF aa 44737
584 FF aa 44737 FF aa 44737 FF bb 44737 FF bb 44737 FF bb 44737
585 FF bb 44737 FF bb 44737 FF bb 44737 GG aa 44737 GG aa 44737
586 GG aa 44737 GG aa 44737 GG bb 44737 GG bb 44737 GG bb 44737
587 GG bb 44737 HH aa 44737 HH aa 44737 HH aa 44737 HH bb 44737
588 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737
589 II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737
590 II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737
591 JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737}
593 do_execsql_test 1.4.2 {
594 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
595 } {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737
596 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737
597 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737
598 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737
599 CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737
600 CC bb 44737 DD aa 44737 DD aa 44737 DD aa 44737 DD bb 44737
601 DD bb 44737 DD bb 44737 DD bb 44737 EE aa 44737 EE aa 44737
602 EE bb 44737 EE bb 44737 EE bb 44737 FF aa 44737 FF aa 44737
603 FF aa 44737 FF aa 44737 FF bb 44737 FF bb 44737 FF bb 44737
604 FF bb 44737 FF bb 44737 FF bb 44737 GG aa 44737 GG aa 44737
605 GG aa 44737 GG aa 44737 GG bb 44737 GG bb 44737 GG bb 44737
606 GG bb 44737 HH aa 44737 HH aa 44737 HH aa 44737 HH bb 44737
607 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737 HH bb 44737
608 II aa 44737 II aa 44737 II bb 44737 II bb 44737 II bb 44737
609 II bb 44737 II bb 44737 JJ aa 44737 JJ aa 44737 JJ aa 44737
610 JJ aa 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737 JJ bb 44737}
612 do_execsql_test 1.4.3 {
613 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
614 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
615 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
616 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
617 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
618 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
619 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
620 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
621 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
622 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
623 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
624 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
625 JJ bb 73 JJ bb 73 JJ bb 73}
627 do_execsql_test 1.4.4 {
628 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
629 } {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979
630 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979
631 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979
632 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979
633 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979
634 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979
635 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979
636 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979
637 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979
638 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979
639 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
640 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979
641 JJ aa 979 JJ aa 979 JJ aa 979 JJ aa 979 JJ bb 979 JJ bb 979
644 do_execsql_test 1.4.5 {
645 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
646 } {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102
647 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102
648 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102
649 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102
650 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102
651 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102
652 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102
653 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
654 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
655 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 102
656 HH bb 102 HH bb 102 HH bb 102 HH bb 102 HH bb 102 II aa 102
657 II aa 102 II bb 102 II bb 102 II bb 102 II bb 102 II bb 102
658 JJ aa 102 JJ aa 102 JJ aa 102 JJ aa 102 JJ bb 102 JJ bb 102
661 do_execsql_test 1.4.6 {
662 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
663 } {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867
664 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077
665 BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897
666 BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104
667 CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915
668 CC bb 44391 DD aa 43892 DD aa 44481 DD aa 44513 DD bb 43778
669 DD bb 43943 DD bb 44021 DD bb 44499 EE aa 43960 EE aa 44624
670 EE bb 43969 EE bb 44108 EE bb 44485 FF aa 44067 FF aa 44070
671 FF aa 44119 FF aa 44529 FF bb 43799 FF bb 43867 FF bb 44011
672 FF bb 44163 FF bb 44442 FF bb 44635 GG aa 44103 GG aa 44257
673 GG aa 44402 GG aa 44589 GG bb 43799 GG bb 43808 GG bb 43893
674 GG bb 44577 HH aa 43758 HH aa 43947 HH aa 44257 HH bb 43774
675 HH bb 44007 HH bb 44054 HH bb 44382 HH bb 44407 HH bb 44604
676 II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294
677 II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503
678 JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480}
680 do_execsql_test 1.4.7 {
681 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
682 } {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867
683 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077
684 BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897
685 BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104
686 CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915
687 CC bb 44391 DD aa 43892 DD aa 44481 DD aa 44513 DD bb 43778
688 DD bb 43943 DD bb 44021 DD bb 44499 EE aa 43960 EE aa 44624
689 EE bb 43969 EE bb 44108 EE bb 44485 FF aa 44067 FF aa 44070
690 FF aa 44119 FF aa 44529 FF bb 43799 FF bb 43867 FF bb 44011
691 FF bb 44163 FF bb 44442 FF bb 44635 GG aa 44103 GG aa 44257
692 GG aa 44402 GG aa 44589 GG bb 43799 GG bb 43808 GG bb 43893
693 GG bb 44577 HH aa 43758 HH aa 43947 HH aa 44257 HH bb 43774
694 HH bb 44007 HH bb 44054 HH bb 44382 HH bb 44407 HH bb 44604
695 II aa 44085 II aa 44339 II bb 43932 II bb 44066 II bb 44294
696 II bb 44316 II bb 44487 JJ aa 43838 JJ aa 43969 JJ aa 44503
697 JJ aa 44624 JJ bb 43898 JJ bb 44383 JJ bb 44401 JJ bb 44480}
699 do_execsql_test 1.4.8 {
701 sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW),
702 sum(c) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ),
703 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW),
704 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING )
705 FROM t3 ORDER BY 1, 2, 3;
706 } {AA aa 43803 44737 43803 44737 AA aa 43826 44737 43826 44737
707 AA aa 44498 44737 44498 44737 AA aa 44514 44737 44514 44737
708 AA bb 43867 44737 43867 44737 AA bb 44110 44737 44110 44737
709 AA bb 44165 44737 44165 44737 AA bb 44428 44737 44428 44737
710 BB aa 43975 44737 43975 44737 BB aa 44077 44737 44077 44737
711 BB aa 44325 44737 44325 44737 BB aa 44338 44737 44338 44737
712 BB aa 44344 44737 44344 44737 BB aa 44490 44737 44490 44737
713 BB bb 43897 44737 43897 44737 BB bb 43945 44737 43945 44737
714 BB bb 43951 44737 43951 44737 BB bb 44026 44737 44026 44737
715 BB bb 44032 44737 44032 44737 BB bb 44104 44737 44104 44737
716 CC aa 43978 44737 43978 44737 CC aa 44130 44737 44130 44737
717 CC aa 44307 44737 44307 44737 CC aa 44579 44737 44579 44737
718 CC bb 43915 44737 43915 44737 CC bb 44391 44737 44391 44737
719 DD aa 43892 44737 43892 44737 DD aa 44481 44737 44481 44737
720 DD aa 44513 44737 44513 44737 DD bb 43778 44737 43778 44737
721 DD bb 43943 44737 43943 44737 DD bb 44021 44737 44021 44737
722 DD bb 44499 44737 44499 44737 EE aa 43960 44737 43960 44737
723 EE aa 44624 44737 44624 44737 EE bb 43969 44737 43969 44737
724 EE bb 44108 44737 44108 44737 EE bb 44485 44737 44485 44737
725 FF aa 44067 44737 44067 44737 FF aa 44070 44737 44070 44737
726 FF aa 44119 44737 44119 44737 FF aa 44529 44737 44529 44737
727 FF bb 43799 44737 43799 44737 FF bb 43867 44737 43867 44737
728 FF bb 44011 44737 44011 44737 FF bb 44163 44737 44163 44737
729 FF bb 44442 44737 44442 44737 FF bb 44635 44737 44635 44737
730 GG aa 44103 44737 44103 44737 GG aa 44257 44737 44257 44737
731 GG aa 44402 44737 44402 44737 GG aa 44589 44737 44589 44737
732 GG bb 43799 44737 43799 44737 GG bb 43808 44737 43808 44737
733 GG bb 43893 44737 43893 44737 GG bb 44577 44737 44577 44737
734 HH aa 43758 44737 43758 44737 HH aa 43947 44737 43947 44737
735 HH aa 44257 44737 44257 44737 HH bb 43774 44737 43774 44737
736 HH bb 44007 44737 44007 44737 HH bb 44054 44737 44054 44737
737 HH bb 44382 44737 44382 44737 HH bb 44407 44737 44407 44737
738 HH bb 44604 44737 44604 44737 II aa 44085 44737 44085 44737
739 II aa 44339 44737 44339 44737 II bb 43932 44737 43932 44737
740 II bb 44066 44737 44066 44737 II bb 44294 44737 44294 44737
741 II bb 44316 44737 44316 44737 II bb 44487 44737 44487 44737
742 JJ aa 43838 44737 43838 44737 JJ aa 43969 44737 43969 44737
743 JJ aa 44503 44737 44503 44737 JJ aa 44624 44737 44624 44737
744 JJ bb 43898 44737 43898 44737 JJ bb 44383 44737 44383 44737
745 JJ bb 44401 44737 44401 44737 JJ bb 44480 44737 44480 44737}
747 do_execsql_test 1.5.1 {
748 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
749 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
750 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
751 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
752 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
753 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
754 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
755 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
756 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
757 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
758 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
759 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
760 JJ bb {} JJ bb {} JJ bb {}}
762 do_execsql_test 1.5.2 {
763 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
764 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
765 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
766 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
767 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
768 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
769 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
770 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
771 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
772 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
773 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
774 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
775 JJ bb {} JJ bb {} JJ bb {}}
777 do_execsql_test 1.5.3 {
778 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
779 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
780 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
781 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
782 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
783 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
784 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
785 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
786 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
787 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
788 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
789 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
790 JJ bb 73 JJ bb 73 JJ bb 73}
792 do_execsql_test 1.5.4 {
793 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
794 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
795 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
796 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
797 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
798 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
799 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
800 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
801 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
802 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
803 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
804 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
805 JJ bb {} JJ bb {} JJ bb {}}
807 do_execsql_test 1.5.5 {
808 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
809 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
810 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
811 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
812 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
813 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
814 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
815 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
816 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
817 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
818 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
819 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
820 JJ bb {} JJ bb {} JJ bb {}}
822 do_execsql_test 1.5.6 {
823 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
824 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
825 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
826 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
827 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
828 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
829 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
830 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
831 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
832 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
833 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
834 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
835 JJ bb {} JJ bb {} JJ bb {}}
837 do_execsql_test 1.5.7 {
838 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
839 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
840 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
841 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
842 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
843 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
844 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
845 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
846 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
847 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
848 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
849 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
850 JJ bb {} JJ bb {} JJ bb {}}
852 do_execsql_test 1.5.8 {
854 sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING EXCLUDE CURRENT ROW),
855 sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING ),
856 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING EXCLUDE CURRENT ROW),
857 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 PRECEDING AND 2 PRECEDING )
858 FROM t3 ORDER BY 1, 2, 3;
859 } {AA aa {} {} {} {} AA aa {} {} {} {} AA aa {} {} {} {}
860 AA aa {} {} {} {} AA bb {} {} {} {} AA bb {} {} {} {}
861 AA bb {} {} {} {} AA bb {} {} {} {} BB aa {} {} {} {}
862 BB aa {} {} {} {} BB aa {} {} {} {} BB aa {} {} {} {}
863 BB aa {} {} {} {} BB aa {} {} {} {} BB bb {} {} {} {}
864 BB bb {} {} {} {} BB bb {} {} {} {} BB bb {} {} {} {}
865 BB bb {} {} {} {} BB bb {} {} {} {} CC aa {} {} {} {}
866 CC aa {} {} {} {} CC aa {} {} {} {} CC aa {} {} {} {}
867 CC bb {} {} {} {} CC bb {} {} {} {} DD aa {} {} {} {}
868 DD aa {} {} {} {} DD aa {} {} {} {} DD bb {} {} {} {}
869 DD bb {} {} {} {} DD bb {} {} {} {} DD bb {} {} {} {}
870 EE aa {} {} {} {} EE aa {} {} {} {} EE bb {} {} {} {}
871 EE bb {} {} {} {} EE bb {} {} {} {} FF aa {} {} {} {}
872 FF aa {} {} {} {} FF aa {} {} {} {} FF aa {} {} {} {}
873 FF bb {} {} {} {} FF bb {} {} {} {} FF bb {} {} {} {}
874 FF bb {} {} {} {} FF bb {} {} {} {} FF bb {} {} {} {}
875 GG aa {} {} {} {} GG aa {} {} {} {} GG aa {} {} {} {}
876 GG aa {} {} {} {} GG bb {} {} {} {} GG bb {} {} {} {}
877 GG bb {} {} {} {} GG bb {} {} {} {} HH aa {} {} {} {}
878 HH aa {} {} {} {} HH aa {} {} {} {} HH bb {} {} {} {}
879 HH bb {} {} {} {} HH bb {} {} {} {} HH bb {} {} {} {}
880 HH bb {} {} {} {} HH bb {} {} {} {} II aa {} {} {} {}
881 II aa {} {} {} {} II bb {} {} {} {} II bb {} {} {} {}
882 II bb {} {} {} {} II bb {} {} {} {} II bb {} {} {} {}
883 JJ aa {} {} {} {} JJ aa {} {} {} {} JJ aa {} {} {} {}
884 JJ aa {} {} {} {} JJ bb {} {} {} {} JJ bb {} {} {} {}
885 JJ bb {} {} {} {} JJ bb {} {} {} {}}
887 do_execsql_test 1.6.1 {
888 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
889 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
890 AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
891 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685
892 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025
893 CC bb 12025 CC bb 12025 DD aa 10462 DD aa 10462 DD aa 10462
894 DD bb 10462 DD bb 10462 DD bb 10462 DD bb 10462 EE aa 7154
895 EE aa 7154 EE bb 7154 EE bb 7154 EE bb 7154 FF aa 6571 FF aa 6571
896 FF aa 6571 FF aa 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571
897 FF bb 6571 FF bb 6571 GG aa 8207 GG aa 8207 GG aa 8207 GG aa 8207
898 GG bb 8207 GG bb 8207 GG bb 8207 GG bb 8207 HH aa 10136
899 HH aa 10136 HH aa 10136 HH bb 10136 HH bb 10136 HH bb 10136
900 HH bb 10136 HH bb 10136 HH bb 10136 II aa 9911 II aa 9911
901 II bb 9911 II bb 9911 II bb 9911 II bb 9911 II bb 9911 JJ aa 9083
902 JJ aa 9083 JJ aa 9083 JJ aa 9083 JJ bb 9083 JJ bb 9083 JJ bb 9083
905 do_execsql_test 1.6.2 {
906 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
907 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307
908 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
909 BB aa 4685 BB aa 4685 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251
910 BB bb 5251 BB bb 5251 CC aa 7340 CC aa 7340 CC aa 7340 CC aa 7340
911 CC bb 6421 CC bb 6421 DD aa 3122 DD aa 3122 DD aa 3122 DD bb 2493
912 DD bb 2493 DD bb 2493 DD bb 2493 EE aa 4032 EE aa 4032 EE bb 3597
913 EE bb 3597 EE bb 3597 FF aa 2539 FF aa 2539 FF aa 2539 FF aa 2539
914 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812
915 GG aa 5668 GG aa 5668 GG aa 5668 GG aa 5668 GG bb 5102 GG bb 5102
916 GG bb 5102 GG bb 5102 HH aa 4468 HH aa 4468 HH aa 4468 HH bb 5120
917 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 II aa 5443
918 II aa 5443 II bb 4244 II bb 4244 II bb 4244 II bb 4244 II bb 4244
919 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ bb 4604 JJ bb 4604
920 JJ bb 4604 JJ bb 4604}
922 do_execsql_test 1.6.3 {
923 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
924 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
925 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
926 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
927 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
928 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
929 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
930 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
931 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
932 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
933 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
934 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
935 JJ bb 73 JJ bb 73 JJ bb 73}
937 do_execsql_test 1.6.4 {
938 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
939 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934
940 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934
941 BB aa 934 BB aa 934 BB bb 870 BB bb 870 BB bb 870 BB bb 870
942 BB bb 870 BB bb 870 CC aa 840 CC aa 840 CC aa 840 CC aa 840
943 CC bb 840 CC bb 840 DD aa 822 DD aa 822 DD aa 822 DD bb 845
944 DD bb 845 DD bb 845 DD bb 845 EE aa 959 EE aa 959 EE bb 959
945 EE bb 959 EE bb 959 FF aa 777 FF aa 777 FF aa 777 FF aa 777
946 FF bb 768 FF bb 768 FF bb 768 FF bb 768 FF bb 768 FF bb 768
947 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938
948 GG bb 938 GG bb 938 HH aa 938 HH aa 938 HH aa 938 HH bb 979
949 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
950 II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963
951 JJ aa 805 JJ aa 805 JJ aa 805 JJ aa 805 JJ bb 899 JJ bb 899
954 do_execsql_test 1.6.5 {
955 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
956 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223
957 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223
958 BB aa 223 BB aa 223 BB bb 247 BB bb 247 BB bb 247 BB bb 247
959 BB bb 247 BB bb 247 CC aa 247 CC aa 247 CC aa 247 CC aa 247
960 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 224
961 DD bb 224 DD bb 224 DD bb 224 EE aa 224 EE aa 224 EE bb 113
962 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113
963 FF bb 208 FF bb 208 FF bb 208 FF bb 208 FF bb 208 FF bb 208
964 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
965 GG bb 102 GG bb 102 HH aa 148 HH aa 148 HH aa 148 HH bb 160
966 HH bb 160 HH bb 160 HH bb 160 HH bb 160 HH bb 160 II aa 133
967 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133
968 JJ aa 250 JJ aa 250 JJ aa 250 JJ aa 250 JJ bb 113 JJ bb 113
971 do_execsql_test 1.6.6 {
972 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
973 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
974 AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
975 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685
976 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025
977 CC bb 12025 CC bb 12025 DD aa 10462 DD aa 10462 DD aa 10462
978 DD bb 10462 DD bb 10462 DD bb 10462 DD bb 10462 EE aa 7154
979 EE aa 7154 EE bb 7154 EE bb 7154 EE bb 7154 FF aa 6571 FF aa 6571
980 FF aa 6571 FF aa 6571 FF bb 6571 FF bb 6571 FF bb 6571 FF bb 6571
981 FF bb 6571 FF bb 6571 GG aa 8207 GG aa 8207 GG aa 8207 GG aa 8207
982 GG bb 8207 GG bb 8207 GG bb 8207 GG bb 8207 HH aa 10136
983 HH aa 10136 HH aa 10136 HH bb 10136 HH bb 10136 HH bb 10136
984 HH bb 10136 HH bb 10136 HH bb 10136 II aa 9911 II aa 9911
985 II bb 9911 II bb 9911 II bb 9911 II bb 9911 II bb 9911 JJ aa 9083
986 JJ aa 9083 JJ aa 9083 JJ aa 9083 JJ bb 9083 JJ bb 9083 JJ bb 9083
989 do_execsql_test 1.6.7 {
990 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
991 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307
992 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
993 BB aa 4685 BB aa 4685 BB bb 5251 BB bb 5251 BB bb 5251 BB bb 5251
994 BB bb 5251 BB bb 5251 CC aa 7340 CC aa 7340 CC aa 7340 CC aa 7340
995 CC bb 6421 CC bb 6421 DD aa 3122 DD aa 3122 DD aa 3122 DD bb 2493
996 DD bb 2493 DD bb 2493 DD bb 2493 EE aa 4032 EE aa 4032 EE bb 3597
997 EE bb 3597 EE bb 3597 FF aa 2539 FF aa 2539 FF aa 2539 FF aa 2539
998 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812 FF bb 3812
999 GG aa 5668 GG aa 5668 GG aa 5668 GG aa 5668 GG bb 5102 GG bb 5102
1000 GG bb 5102 GG bb 5102 HH aa 4468 HH aa 4468 HH aa 4468 HH bb 5120
1001 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 HH bb 5120 II aa 5443
1002 II aa 5443 II bb 4244 II bb 4244 II bb 4244 II bb 4244 II bb 4244
1003 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ aa 3640 JJ bb 4604 JJ bb 4604
1004 JJ bb 4604 JJ bb 4604}
1006 do_execsql_test 1.6.8 {
1008 sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW),
1009 sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING ),
1010 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW),
1011 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND 1 PRECEDING )
1012 FROM t3 ORDER BY 1, 2, 3;
1013 } {AA aa {} {} {} {} AA aa {} {} {} {} AA aa {} {} {} {}
1014 AA aa {} {} {} {} AA bb {} {} 2307 2307 AA bb {} {} 2307 2307
1015 AA bb {} {} 2307 2307 AA bb {} {} 2307 2307 BB aa 4685 4685 4685 4685
1016 BB aa 4685 4685 4685 4685 BB aa 4685 4685 4685 4685
1017 BB aa 4685 4685 4685 4685 BB aa 4685 4685 4685 4685
1018 BB aa 4685 4685 4685 4685 BB bb 4685 4685 5251 5251
1019 BB bb 4685 4685 5251 5251 BB bb 4685 4685 5251 5251
1020 BB bb 4685 4685 5251 5251 BB bb 4685 4685 5251 5251
1021 BB bb 4685 4685 5251 5251 CC aa 12025 12025 7340 7340
1022 CC aa 12025 12025 7340 7340 CC aa 12025 12025 7340 7340
1023 CC aa 12025 12025 7340 7340 CC bb 12025 12025 6421 6421
1024 CC bb 12025 12025 6421 6421 DD aa 10462 10462 3122 3122
1025 DD aa 10462 10462 3122 3122 DD aa 10462 10462 3122 3122
1026 DD bb 10462 10462 2493 2493 DD bb 10462 10462 2493 2493
1027 DD bb 10462 10462 2493 2493 DD bb 10462 10462 2493 2493
1028 EE aa 7154 7154 4032 4032 EE aa 7154 7154 4032 4032
1029 EE bb 7154 7154 3597 3597 EE bb 7154 7154 3597 3597
1030 EE bb 7154 7154 3597 3597 FF aa 6571 6571 2539 2539
1031 FF aa 6571 6571 2539 2539 FF aa 6571 6571 2539 2539
1032 FF aa 6571 6571 2539 2539 FF bb 6571 6571 3812 3812
1033 FF bb 6571 6571 3812 3812 FF bb 6571 6571 3812 3812
1034 FF bb 6571 6571 3812 3812 FF bb 6571 6571 3812 3812
1035 FF bb 6571 6571 3812 3812 GG aa 8207 8207 5668 5668
1036 GG aa 8207 8207 5668 5668 GG aa 8207 8207 5668 5668
1037 GG aa 8207 8207 5668 5668 GG bb 8207 8207 5102 5102
1038 GG bb 8207 8207 5102 5102 GG bb 8207 8207 5102 5102
1039 GG bb 8207 8207 5102 5102 HH aa 10136 10136 4468 4468
1040 HH aa 10136 10136 4468 4468 HH aa 10136 10136 4468 4468
1041 HH bb 10136 10136 5120 5120 HH bb 10136 10136 5120 5120
1042 HH bb 10136 10136 5120 5120 HH bb 10136 10136 5120 5120
1043 HH bb 10136 10136 5120 5120 HH bb 10136 10136 5120 5120
1044 II aa 9911 9911 5443 5443 II aa 9911 9911 5443 5443
1045 II bb 9911 9911 4244 4244 II bb 9911 9911 4244 4244
1046 II bb 9911 9911 4244 4244 II bb 9911 9911 4244 4244
1047 II bb 9911 9911 4244 4244 JJ aa 9083 9083 3640 3640
1048 JJ aa 9083 9083 3640 3640 JJ aa 9083 9083 3640 3640
1049 JJ aa 9083 9083 3640 3640 JJ bb 9083 9083 4604 4604
1050 JJ bb 9083 9083 4604 4604 JJ bb 9083 9083 4604 4604
1051 JJ bb 9083 9083 4604 4604}
1053 do_execsql_test 1.7.1 {
1054 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1055 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
1056 AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
1057 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685
1058 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025
1059 CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147
1060 DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 14494
1061 EE aa 14494 EE bb 14494 EE bb 14494 EE bb 14494 FF aa 9693
1062 FF aa 9693 FF aa 9693 FF aa 9693 FF bb 9693 FF bb 9693 FF bb 9693
1063 FF bb 9693 FF bb 9693 FF bb 9693 GG aa 12239 GG aa 12239
1064 GG aa 12239 GG aa 12239 GG bb 12239 GG bb 12239 GG bb 12239
1065 GG bb 12239 HH aa 12675 HH aa 12675 HH aa 12675 HH bb 12675
1066 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675
1067 II aa 15579 II aa 15579 II bb 15579 II bb 15579 II bb 15579
1068 II bb 15579 II bb 15579 JJ aa 13551 JJ aa 13551 JJ aa 13551
1069 JJ aa 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551}
1071 do_execsql_test 1.7.2 {
1072 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1073 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307
1074 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
1075 BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558
1076 BB bb 7558 BB bb 7558 CC aa 9718 CC aa 9718 CC aa 9718 CC aa 9718
1077 CC bb 9294 CC bb 9294 DD aa 7589 DD aa 7589 DD aa 7589 DD bb 4447
1078 DD bb 4447 DD bb 4447 DD bb 4447 EE aa 5200 EE aa 5200 EE bb 4922
1079 EE bb 4922 EE bb 4922 FF aa 5246 FF aa 5246 FF aa 5246 FF aa 5246
1080 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702
1081 GG aa 7317 GG aa 7317 GG aa 7317 GG aa 7317 GG bb 7265 GG bb 7265
1082 GG bb 7265 GG bb 7265 HH aa 7973 HH aa 7973 HH aa 7973 HH bb 6717
1083 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 II aa 8314
1084 II aa 8314 II bb 6493 II bb 6493 II bb 6493 II bb 6493 II bb 6493
1085 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ bb 5654 JJ bb 5654
1086 JJ bb 5654 JJ bb 5654}
1088 do_execsql_test 1.7.3 {
1089 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1090 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
1091 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
1092 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
1093 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
1094 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
1095 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
1096 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
1097 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
1098 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
1099 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
1100 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
1101 JJ bb 73 JJ bb 73 JJ bb 73}
1103 do_execsql_test 1.7.4 {
1104 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1105 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 934 AA bb 934
1106 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934
1107 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934
1108 BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870
1109 CC bb 840 CC bb 840 DD aa 840 DD aa 840 DD aa 840 DD bb 845
1110 DD bb 845 DD bb 845 DD bb 845 EE aa 959 EE aa 959 EE bb 959
1111 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959
1112 FF bb 777 FF bb 777 FF bb 777 FF bb 777 FF bb 777 FF bb 777
1113 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938
1114 GG bb 938 GG bb 938 HH aa 938 HH aa 938 HH aa 938 HH bb 979
1115 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
1116 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979
1117 JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899
1118 JJ bb 899 JJ bb 899}
1120 do_execsql_test 1.7.5 {
1121 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1122 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 223 AA bb 223
1123 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223
1124 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223
1125 BB bb 223 BB bb 223 CC aa 247 CC aa 247 CC aa 247 CC aa 247
1126 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158
1127 DD bb 158 DD bb 158 DD bb 158 EE aa 224 EE aa 224 EE bb 113
1128 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113
1129 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113
1130 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
1131 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 148
1132 HH bb 148 HH bb 148 HH bb 148 HH bb 148 HH bb 148 II aa 133
1133 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133
1134 JJ aa 133 JJ aa 133 JJ aa 133 JJ aa 133 JJ bb 113 JJ bb 113
1135 JJ bb 113 JJ bb 113}
1137 do_execsql_test 1.7.6 {
1138 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1139 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
1140 AA bb {} BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
1141 BB aa 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685 BB bb 4685
1142 BB bb 4685 CC aa 12025 CC aa 12025 CC aa 12025 CC aa 12025
1143 CC bb 12025 CC bb 12025 DD aa 15147 DD aa 15147 DD aa 15147
1144 DD bb 15147 DD bb 15147 DD bb 15147 DD bb 15147 EE aa 14494
1145 EE aa 14494 EE bb 14494 EE bb 14494 EE bb 14494 FF aa 9693
1146 FF aa 9693 FF aa 9693 FF aa 9693 FF bb 9693 FF bb 9693 FF bb 9693
1147 FF bb 9693 FF bb 9693 FF bb 9693 GG aa 12239 GG aa 12239
1148 GG aa 12239 GG aa 12239 GG bb 12239 GG bb 12239 GG bb 12239
1149 GG bb 12239 HH aa 12675 HH aa 12675 HH aa 12675 HH bb 12675
1150 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675 HH bb 12675
1151 II aa 15579 II aa 15579 II bb 15579 II bb 15579 II bb 15579
1152 II bb 15579 II bb 15579 JJ aa 13551 JJ aa 13551 JJ aa 13551
1153 JJ aa 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551 JJ bb 13551}
1155 do_execsql_test 1.7.7 {
1156 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1157 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb 2307 AA bb 2307
1158 AA bb 2307 AA bb 2307 BB aa 4685 BB aa 4685 BB aa 4685 BB aa 4685
1159 BB aa 4685 BB aa 4685 BB bb 7558 BB bb 7558 BB bb 7558 BB bb 7558
1160 BB bb 7558 BB bb 7558 CC aa 9718 CC aa 9718 CC aa 9718 CC aa 9718
1161 CC bb 9294 CC bb 9294 DD aa 7589 DD aa 7589 DD aa 7589 DD bb 4447
1162 DD bb 4447 DD bb 4447 DD bb 4447 EE aa 5200 EE aa 5200 EE bb 4922
1163 EE bb 4922 EE bb 4922 FF aa 5246 FF aa 5246 FF aa 5246 FF aa 5246
1164 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702 FF bb 4702
1165 GG aa 7317 GG aa 7317 GG aa 7317 GG aa 7317 GG bb 7265 GG bb 7265
1166 GG bb 7265 GG bb 7265 HH aa 7973 HH aa 7973 HH aa 7973 HH bb 6717
1167 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 HH bb 6717 II aa 8314
1168 II aa 8314 II bb 6493 II bb 6493 II bb 6493 II bb 6493 II bb 6493
1169 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ aa 6834 JJ bb 5654 JJ bb 5654
1170 JJ bb 5654 JJ bb 5654}
1172 do_execsql_test 1.7.8 {
1174 sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW),
1175 sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING ),
1176 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING EXCLUDE CURRENT ROW),
1177 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 1 PRECEDING )
1178 FROM t3 ORDER BY 1, 2, 3;
1179 } {AA aa {} {} {} {} AA aa {} {} {} {} AA aa {} {} {} {}
1180 AA aa {} {} {} {} AA bb {} {} 2307 2307 AA bb {} {} 2307 2307
1181 AA bb {} {} 2307 2307 AA bb {} {} 2307 2307 BB aa 4685 4685 4685 4685
1182 BB aa 4685 4685 4685 4685 BB aa 4685 4685 4685 4685
1183 BB aa 4685 4685 4685 4685 BB aa 4685 4685 4685 4685
1184 BB aa 4685 4685 4685 4685 BB bb 4685 4685 7558 7558
1185 BB bb 4685 4685 7558 7558 BB bb 4685 4685 7558 7558
1186 BB bb 4685 4685 7558 7558 BB bb 4685 4685 7558 7558
1187 BB bb 4685 4685 7558 7558 CC aa 12025 12025 9718 9718
1188 CC aa 12025 12025 9718 9718 CC aa 12025 12025 9718 9718
1189 CC aa 12025 12025 9718 9718 CC bb 12025 12025 9294 9294
1190 CC bb 12025 12025 9294 9294 DD aa 15147 15147 7589 7589
1191 DD aa 15147 15147 7589 7589 DD aa 15147 15147 7589 7589
1192 DD bb 15147 15147 4447 4447 DD bb 15147 15147 4447 4447
1193 DD bb 15147 15147 4447 4447 DD bb 15147 15147 4447 4447
1194 EE aa 14494 14494 5200 5200 EE aa 14494 14494 5200 5200
1195 EE bb 14494 14494 4922 4922 EE bb 14494 14494 4922 4922
1196 EE bb 14494 14494 4922 4922 FF aa 9693 9693 5246 5246
1197 FF aa 9693 9693 5246 5246 FF aa 9693 9693 5246 5246
1198 FF aa 9693 9693 5246 5246 FF bb 9693 9693 4702 4702
1199 FF bb 9693 9693 4702 4702 FF bb 9693 9693 4702 4702
1200 FF bb 9693 9693 4702 4702 FF bb 9693 9693 4702 4702
1201 FF bb 9693 9693 4702 4702 GG aa 12239 12239 7317 7317
1202 GG aa 12239 12239 7317 7317 GG aa 12239 12239 7317 7317
1203 GG aa 12239 12239 7317 7317 GG bb 12239 12239 7265 7265
1204 GG bb 12239 12239 7265 7265 GG bb 12239 12239 7265 7265
1205 GG bb 12239 12239 7265 7265 HH aa 12675 12675 7973 7973
1206 HH aa 12675 12675 7973 7973 HH aa 12675 12675 7973 7973
1207 HH bb 12675 12675 6717 6717 HH bb 12675 12675 6717 6717
1208 HH bb 12675 12675 6717 6717 HH bb 12675 12675 6717 6717
1209 HH bb 12675 12675 6717 6717 HH bb 12675 12675 6717 6717
1210 II aa 15579 15579 8314 8314 II aa 15579 15579 8314 8314
1211 II bb 15579 15579 6493 6493 II bb 15579 15579 6493 6493
1212 II bb 15579 15579 6493 6493 II bb 15579 15579 6493 6493
1213 II bb 15579 15579 6493 6493 JJ aa 13551 13551 6834 6834
1214 JJ aa 13551 13551 6834 6834 JJ aa 13551 13551 6834 6834
1215 JJ aa 13551 13551 6834 6834 JJ bb 13551 13551 5654 5654
1216 JJ bb 13551 13551 5654 5654 JJ bb 13551 13551 5654 5654
1217 JJ bb 13551 13551 5654 5654}
1219 do_execsql_test 1.8.1 {
1220 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1221 } {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685
1222 AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025
1223 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025
1224 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147
1225 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147
1226 DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179
1227 DD bb 19179 DD bb 19179 EE aa 17033 EE aa 17033 EE bb 17033
1228 EE bb 17033 EE bb 17033 FF aa 15361 FF aa 15361 FF aa 15361
1229 FF aa 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361
1230 FF bb 15361 FF bb 15361 GG aa 16707 GG aa 16707 GG aa 16707
1231 GG aa 16707 GG bb 16707 GG bb 16707 GG bb 16707 GG bb 16707
1232 HH aa 18118 HH aa 18118 HH aa 18118 HH bb 18118 HH bb 18118
1233 HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 II aa 19219
1234 II aa 19219 II bb 19219 II bb 19219 II bb 19219 II bb 19219
1235 II bb 19219 JJ aa 17351 JJ aa 17351 JJ aa 17351 JJ aa 17351
1236 JJ bb 17351 JJ bb 17351 JJ bb 17351 JJ bb 17351}
1238 do_execsql_test 1.8.2 {
1239 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1240 } {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685
1241 AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558
1242 BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025
1243 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 11672 CC aa 11672
1244 CC aa 11672 CC aa 11672 CC bb 10462 CC bb 10462 DD aa 8914
1245 DD aa 8914 DD aa 8914 DD bb 7154 DD bb 7154 DD bb 7154 DD bb 7154
1246 EE aa 6090 EE aa 6090 EE bb 6571 EE bb 6571 EE bb 6571 FF aa 7409
1247 FF aa 7409 FF aa 7409 FF aa 7409 FF bb 8207 FF bb 8207 FF bb 8207
1248 FF bb 8207 FF bb 8207 FF bb 8207 GG aa 8914 GG aa 8914 GG aa 8914
1249 GG aa 8914 GG bb 10136 GG bb 10136 GG bb 10136 GG bb 10136
1250 HH aa 10222 HH aa 10222 HH aa 10222 HH bb 9911 HH bb 9911
1251 HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 II aa 9364 II aa 9364
1252 II bb 9083 II bb 9083 II bb 9083 II bb 9083 II bb 9083 JJ aa 8848
1253 JJ aa 8848 JJ aa 8848 JJ aa 8848 JJ bb 7440 JJ bb 7440 JJ bb 7440
1256 do_execsql_test 1.8.3 {
1257 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1258 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
1259 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
1260 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
1261 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
1262 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
1263 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
1264 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
1265 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
1266 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
1267 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
1268 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
1269 JJ bb 73 JJ bb 73 JJ bb 73}
1271 do_execsql_test 1.8.4 {
1272 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1273 } {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934
1274 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934
1275 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934
1276 BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870
1277 CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959
1278 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959
1279 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959
1280 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938
1281 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938
1282 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979
1283 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
1284 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979
1285 JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899
1286 JJ bb 899 JJ bb 899}
1288 do_execsql_test 1.8.5 {
1289 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ) FROM t3 ORDER BY 1, 2, 3;
1290 } {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223
1291 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223
1292 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223
1293 BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158
1294 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158
1295 DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113
1296 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113
1297 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
1298 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
1299 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 133
1300 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133
1301 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133
1302 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113
1303 JJ bb 113 JJ bb 113}
1305 do_execsql_test 1.8.6 {
1306 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1307 } {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058
1308 AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613
1309 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233
1310 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388
1311 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801
1312 DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385
1313 DD bb 18463 DD bb 18941 EE aa 16256 EE aa 16920 EE bb 16265
1314 EE bb 16404 EE bb 16781 FF aa 14691 FF aa 14694 FF aa 14743
1315 FF aa 15153 FF bb 14423 FF bb 14491 FF bb 14635 FF bb 14787
1316 FF bb 15066 FF bb 15259 GG aa 16073 GG aa 16227 GG aa 16372
1317 GG aa 16559 GG bb 15769 GG bb 15778 GG bb 15863 GG bb 16547
1318 HH aa 17139 HH aa 17328 HH aa 17638 HH bb 17155 HH bb 17388
1319 HH bb 17435 HH bb 17763 HH bb 17788 HH bb 17985 II aa 18567
1320 II aa 18821 II bb 18414 II bb 18548 II bb 18776 II bb 18798
1321 II bb 18969 JJ aa 16452 JJ aa 16583 JJ aa 17117 JJ aa 17238
1322 JJ bb 16512 JJ bb 16997 JJ bb 17015 JJ bb 17094}
1324 do_execsql_test 1.8.7 {
1325 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1326 } {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058
1327 AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159
1328 BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239
1329 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 10913 CC aa 11065
1330 CC aa 11242 CC aa 11514 CC bb 9640 CC bb 10116 DD aa 8069
1331 DD aa 8658 DD aa 8690 DD bb 6195 DD bb 6360 DD bb 6438 DD bb 6916
1332 EE aa 5313 EE aa 5977 EE bb 5803 EE bb 5942 EE bb 6319 FF aa 6739
1333 FF aa 6742 FF aa 6791 FF aa 7201 FF bb 7269 FF bb 7337 FF bb 7481
1334 FF bb 7633 FF bb 7912 FF bb 8105 GG aa 8280 GG aa 8434 GG aa 8579
1335 GG aa 8766 GG bb 9198 GG bb 9207 GG bb 9292 GG bb 9976 HH aa 9243
1336 HH aa 9432 HH aa 9742 HH bb 8948 HH bb 9181 HH bb 9228 HH bb 9556
1337 HH bb 9581 HH bb 9778 II aa 8712 II aa 8966 II bb 8278 II bb 8412
1338 II bb 8640 II bb 8662 II bb 8833 JJ aa 7949 JJ aa 8080 JJ aa 8614
1339 JJ aa 8735 JJ bb 6601 JJ bb 7086 JJ bb 7104 JJ bb 7183}
1341 do_execsql_test 1.8.8 {
1343 sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING EXCLUDE CURRENT ROW),
1344 sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING ),
1345 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING EXCLUDE CURRENT ROW),
1346 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 PRECEDING )
1347 FROM t3 ORDER BY 1, 2, 3;
1348 } {AA aa 3751 4685 1373 2307 AA aa 3774 4685 1396 2307
1349 AA aa 4446 4685 2068 2307 AA aa 4462 4685 2084 2307
1350 AA bb 3815 4685 3815 4685 AA bb 4058 4685 4058 4685
1351 AA bb 4113 4685 4113 4685 AA bb 4376 4685 4376 4685
1352 BB aa 11263 12025 6796 7558 BB aa 11365 12025 6898 7558
1353 BB aa 11613 12025 7146 7558 BB aa 11626 12025 7159 7558
1354 BB aa 11632 12025 7165 7558 BB aa 11778 12025 7311 7558
1355 BB bb 11185 12025 11185 12025 BB bb 11233 12025 11233 12025
1356 BB bb 11239 12025 11239 12025 BB bb 11314 12025 11314 12025
1357 BB bb 11320 12025 11320 12025 BB bb 11392 12025 11392 12025
1358 CC aa 14388 15147 10913 11672 CC aa 14540 15147 11065 11672
1359 CC aa 14717 15147 11242 11672 CC aa 14989 15147 11514 11672
1360 CC bb 14325 15147 9640 10462 CC bb 14801 15147 10116 10462
1361 DD aa 18334 19179 8069 8914 DD aa 18923 19179 8658 8914
1362 DD aa 18955 19179 8690 8914 DD bb 18220 19179 6195 7154
1363 DD bb 18385 19179 6360 7154 DD bb 18463 19179 6438 7154
1364 DD bb 18941 19179 6916 7154 EE aa 16256 17033 5313 6090
1365 EE aa 16920 17033 5977 6090 EE bb 16265 17033 5803 6571
1366 EE bb 16404 17033 5942 6571 EE bb 16781 17033 6319 6571
1367 FF aa 14691 15361 6739 7409 FF aa 14694 15361 6742 7409
1368 FF aa 14743 15361 6791 7409 FF aa 15153 15361 7201 7409
1369 FF bb 14423 15361 7269 8207 FF bb 14491 15361 7337 8207
1370 FF bb 14635 15361 7481 8207 FF bb 14787 15361 7633 8207
1371 FF bb 15066 15361 7912 8207 FF bb 15259 15361 8105 8207
1372 GG aa 16073 16707 8280 8914 GG aa 16227 16707 8434 8914
1373 GG aa 16372 16707 8579 8914 GG aa 16559 16707 8766 8914
1374 GG bb 15769 16707 9198 10136 GG bb 15778 16707 9207 10136
1375 GG bb 15863 16707 9292 10136 GG bb 16547 16707 9976 10136
1376 HH aa 17139 18118 9243 10222 HH aa 17328 18118 9432 10222
1377 HH aa 17638 18118 9742 10222 HH bb 17155 18118 8948 9911
1378 HH bb 17388 18118 9181 9911 HH bb 17435 18118 9228 9911
1379 HH bb 17763 18118 9556 9911 HH bb 17788 18118 9581 9911
1380 HH bb 17985 18118 9778 9911 II aa 18567 19219 8712 9364
1381 II aa 18821 19219 8966 9364 II bb 18414 19219 8278 9083
1382 II bb 18548 19219 8412 9083 II bb 18776 19219 8640 9083
1383 II bb 18798 19219 8662 9083 II bb 18969 19219 8833 9083
1384 JJ aa 16452 17351 7949 8848 JJ aa 16583 17351 8080 8848
1385 JJ aa 17117 17351 8614 8848 JJ aa 17238 17351 8735 8848
1386 JJ bb 16512 17351 6601 7440 JJ bb 16997 17351 7086 7440
1387 JJ bb 17015 17351 7104 7440 JJ bb 17094 17351 7183 7440}
1389 do_execsql_test 1.9.1 {
1390 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
1391 } {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685
1392 AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025
1393 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025
1394 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147
1395 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147
1396 DD aa 14494 DD aa 14494 DD aa 14494 DD bb 14494 DD bb 14494
1397 DD bb 14494 DD bb 14494 EE aa 9693 EE aa 9693 EE bb 9693
1398 EE bb 9693 EE bb 9693 FF aa 12239 FF aa 12239 FF aa 12239
1399 FF aa 12239 FF bb 12239 FF bb 12239 FF bb 12239 FF bb 12239
1400 FF bb 12239 FF bb 12239 GG aa 12675 GG aa 12675 GG aa 12675
1401 GG aa 12675 GG bb 12675 GG bb 12675 GG bb 12675 GG bb 12675
1402 HH aa 15579 HH aa 15579 HH aa 15579 HH bb 15579 HH bb 15579
1403 HH bb 15579 HH bb 15579 HH bb 15579 HH bb 15579 II aa 13551
1404 II aa 13551 II bb 13551 II bb 13551 II bb 13551 II bb 13551
1405 II bb 13551 JJ aa 12883 JJ aa 12883 JJ aa 12883 JJ aa 12883
1406 JJ bb 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883}
1408 do_execsql_test 1.9.2 {
1409 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
1410 } {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685
1411 AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558
1412 BB aa 7558 BB aa 7558 BB bb 9718 BB bb 9718 BB bb 9718 BB bb 9718
1413 BB bb 9718 BB bb 9718 CC aa 9294 CC aa 9294 CC aa 9294 CC aa 9294
1414 CC bb 7589 CC bb 7589 DD aa 4447 DD aa 4447 DD aa 4447 DD bb 5200
1415 DD bb 5200 DD bb 5200 DD bb 5200 EE aa 4922 EE aa 4922 EE bb 5246
1416 EE bb 5246 EE bb 5246 FF aa 4702 FF aa 4702 FF aa 4702 FF aa 4702
1417 FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317 FF bb 7317
1418 GG aa 7265 GG aa 7265 GG aa 7265 GG aa 7265 GG bb 7973 GG bb 7973
1419 GG bb 7973 GG bb 7973 HH aa 6717 HH aa 6717 HH aa 6717 HH bb 8314
1420 HH bb 8314 HH bb 8314 HH bb 8314 HH bb 8314 HH bb 8314 II aa 6493
1421 II aa 6493 II bb 6834 II bb 6834 II bb 6834 II bb 6834 II bb 6834
1422 JJ aa 5654 JJ aa 5654 JJ aa 5654 JJ aa 5654 JJ bb 6390 JJ bb 6390
1423 JJ bb 6390 JJ bb 6390}
1425 do_execsql_test 1.9.3 {
1426 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
1427 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
1428 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
1429 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
1430 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
1431 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
1432 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
1433 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
1434 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
1435 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
1436 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
1437 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
1438 JJ bb 73 JJ bb 73 JJ bb 73}
1440 do_execsql_test 1.9.4 {
1441 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
1442 } {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934
1443 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934
1444 BB aa 934 BB aa 934 BB bb 870 BB bb 870 BB bb 870 BB bb 870
1445 BB bb 870 BB bb 870 CC aa 840 CC aa 840 CC aa 840 CC aa 840
1446 CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959
1447 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959
1448 EE bb 959 EE bb 959 FF aa 777 FF aa 777 FF aa 777 FF aa 777
1449 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938
1450 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938
1451 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979
1452 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
1453 II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963
1454 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 899 JJ bb 899
1455 JJ bb 899 JJ bb 899}
1457 do_execsql_test 1.9.5 {
1458 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ) FROM t3 ORDER BY 1, 2, 3;
1459 } {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223
1460 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223
1461 BB aa 223 BB aa 223 BB bb 247 BB bb 247 BB bb 247 BB bb 247
1462 BB bb 247 BB bb 247 CC aa 158 CC aa 158 CC aa 158 CC aa 158
1463 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 224
1464 DD bb 224 DD bb 224 DD bb 224 EE aa 113 EE aa 113 EE bb 113
1465 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113
1466 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
1467 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
1468 GG bb 102 GG bb 102 HH aa 148 HH aa 148 HH aa 148 HH bb 133
1469 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133
1470 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133
1471 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113
1472 JJ bb 113 JJ bb 113}
1474 do_execsql_test 1.9.6 {
1475 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1476 } {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058
1477 AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613
1478 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233
1479 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388
1480 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801
1481 DD aa 13649 DD aa 14238 DD aa 14270 DD bb 13535 DD bb 13700
1482 DD bb 13778 DD bb 14256 EE aa 8916 EE aa 9580 EE bb 8925
1483 EE bb 9064 EE bb 9441 FF aa 11569 FF aa 11572 FF aa 11621
1484 FF aa 12031 FF bb 11301 FF bb 11369 FF bb 11513 FF bb 11665
1485 FF bb 11944 FF bb 12137 GG aa 12041 GG aa 12195 GG aa 12340
1486 GG aa 12527 GG bb 11737 GG bb 11746 GG bb 11831 GG bb 12515
1487 HH aa 14600 HH aa 14789 HH aa 15099 HH bb 14616 HH bb 14849
1488 HH bb 14896 HH bb 15224 HH bb 15249 HH bb 15446 II aa 12899
1489 II aa 13153 II bb 12746 II bb 12880 II bb 13108 II bb 13130
1490 II bb 13301 JJ aa 11984 JJ aa 12115 JJ aa 12649 JJ aa 12770
1491 JJ bb 12044 JJ bb 12529 JJ bb 12547 JJ bb 12626}
1493 do_execsql_test 1.9.7 {
1494 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1495 } {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058
1496 AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159
1497 BB aa 7165 BB aa 7311 BB bb 8878 BB bb 8926 BB bb 8932 BB bb 9007
1498 BB bb 9013 BB bb 9085 CC aa 8535 CC aa 8687 CC aa 8864 CC aa 9136
1499 CC bb 6767 CC bb 7243 DD aa 3602 DD aa 4191 DD aa 4223 DD bb 4241
1500 DD bb 4406 DD bb 4484 DD bb 4962 EE aa 4145 EE aa 4809 EE bb 4478
1501 EE bb 4617 EE bb 4994 FF aa 4032 FF aa 4035 FF aa 4084 FF aa 4494
1502 FF bb 6379 FF bb 6447 FF bb 6591 FF bb 6743 FF bb 7022 FF bb 7215
1503 GG aa 6631 GG aa 6785 GG aa 6930 GG aa 7117 GG bb 7035 GG bb 7044
1504 GG bb 7129 GG bb 7813 HH aa 5738 HH aa 5927 HH aa 6237 HH bb 7351
1505 HH bb 7584 HH bb 7631 HH bb 7959 HH bb 7984 HH bb 8181 II aa 5841
1506 II aa 6095 II bb 6029 II bb 6163 II bb 6391 II bb 6413 II bb 6584
1507 JJ aa 4755 JJ aa 4886 JJ aa 5420 JJ aa 5541 JJ bb 5551 JJ bb 6036
1508 JJ bb 6054 JJ bb 6133}
1510 do_execsql_test 1.9.8 {
1512 sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW),
1513 sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW ),
1514 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW),
1515 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW )
1516 FROM t3 ORDER BY 1, 2, 3;
1517 } {AA aa 3751 4685 1373 2307 AA aa 3774 4685 1396 2307
1518 AA aa 4446 4685 2068 2307 AA aa 4462 4685 2084 2307
1519 AA bb 3815 4685 3815 4685 AA bb 4058 4685 4058 4685
1520 AA bb 4113 4685 4113 4685 AA bb 4376 4685 4376 4685
1521 BB aa 11263 12025 6796 7558 BB aa 11365 12025 6898 7558
1522 BB aa 11613 12025 7146 7558 BB aa 11626 12025 7159 7558
1523 BB aa 11632 12025 7165 7558 BB aa 11778 12025 7311 7558
1524 BB bb 11185 12025 8878 9718 BB bb 11233 12025 8926 9718
1525 BB bb 11239 12025 8932 9718 BB bb 11314 12025 9007 9718
1526 BB bb 11320 12025 9013 9718 BB bb 11392 12025 9085 9718
1527 CC aa 14388 15147 8535 9294 CC aa 14540 15147 8687 9294
1528 CC aa 14717 15147 8864 9294 CC aa 14989 15147 9136 9294
1529 CC bb 14325 15147 6767 7589 CC bb 14801 15147 7243 7589
1530 DD aa 13649 14494 3602 4447 DD aa 14238 14494 4191 4447
1531 DD aa 14270 14494 4223 4447 DD bb 13535 14494 4241 5200
1532 DD bb 13700 14494 4406 5200 DD bb 13778 14494 4484 5200
1533 DD bb 14256 14494 4962 5200 EE aa 8916 9693 4145 4922
1534 EE aa 9580 9693 4809 4922 EE bb 8925 9693 4478 5246
1535 EE bb 9064 9693 4617 5246 EE bb 9441 9693 4994 5246
1536 FF aa 11569 12239 4032 4702 FF aa 11572 12239 4035 4702
1537 FF aa 11621 12239 4084 4702 FF aa 12031 12239 4494 4702
1538 FF bb 11301 12239 6379 7317 FF bb 11369 12239 6447 7317
1539 FF bb 11513 12239 6591 7317 FF bb 11665 12239 6743 7317
1540 FF bb 11944 12239 7022 7317 FF bb 12137 12239 7215 7317
1541 GG aa 12041 12675 6631 7265 GG aa 12195 12675 6785 7265
1542 GG aa 12340 12675 6930 7265 GG aa 12527 12675 7117 7265
1543 GG bb 11737 12675 7035 7973 GG bb 11746 12675 7044 7973
1544 GG bb 11831 12675 7129 7973 GG bb 12515 12675 7813 7973
1545 HH aa 14600 15579 5738 6717 HH aa 14789 15579 5927 6717
1546 HH aa 15099 15579 6237 6717 HH bb 14616 15579 7351 8314
1547 HH bb 14849 15579 7584 8314 HH bb 14896 15579 7631 8314
1548 HH bb 15224 15579 7959 8314 HH bb 15249 15579 7984 8314
1549 HH bb 15446 15579 8181 8314 II aa 12899 13551 5841 6493
1550 II aa 13153 13551 6095 6493 II bb 12746 13551 6029 6834
1551 II bb 12880 13551 6163 6834 II bb 13108 13551 6391 6834
1552 II bb 13130 13551 6413 6834 II bb 13301 13551 6584 6834
1553 JJ aa 11984 12883 4755 5654 JJ aa 12115 12883 4886 5654
1554 JJ aa 12649 12883 5420 5654 JJ aa 12770 12883 5541 5654
1555 JJ bb 12044 12883 5551 6390 JJ bb 12529 12883 6036 6390
1556 JJ bb 12547 12883 6054 6390 JJ bb 12626 12883 6133 6390}
1558 do_execsql_test 1.10.1 {
1559 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1560 } {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685
1561 AA bb 4685 AA bb 4685 BB aa 12025 BB aa 12025 BB aa 12025
1562 BB aa 12025 BB aa 12025 BB aa 12025 BB bb 12025 BB bb 12025
1563 BB bb 12025 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 15147
1564 CC aa 15147 CC aa 15147 CC aa 15147 CC bb 15147 CC bb 15147
1565 DD aa 19179 DD aa 19179 DD aa 19179 DD bb 19179 DD bb 19179
1566 DD bb 19179 DD bb 19179 EE aa 17033 EE aa 17033 EE bb 17033
1567 EE bb 17033 EE bb 17033 FF aa 15361 FF aa 15361 FF aa 15361
1568 FF aa 15361 FF bb 15361 FF bb 15361 FF bb 15361 FF bb 15361
1569 FF bb 15361 FF bb 15361 GG aa 16707 GG aa 16707 GG aa 16707
1570 GG aa 16707 GG bb 16707 GG bb 16707 GG bb 16707 GG bb 16707
1571 HH aa 18118 HH aa 18118 HH aa 18118 HH bb 18118 HH bb 18118
1572 HH bb 18118 HH bb 18118 HH bb 18118 HH bb 18118 II aa 19219
1573 II aa 19219 II bb 19219 II bb 19219 II bb 19219 II bb 19219
1574 II bb 19219 JJ aa 17351 JJ aa 17351 JJ aa 17351 JJ aa 17351
1575 JJ bb 17351 JJ bb 17351 JJ bb 17351 JJ bb 17351}
1577 do_execsql_test 1.10.2 {
1578 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1579 } {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 4685 AA bb 4685
1580 AA bb 4685 AA bb 4685 BB aa 7558 BB aa 7558 BB aa 7558 BB aa 7558
1581 BB aa 7558 BB aa 7558 BB bb 12025 BB bb 12025 BB bb 12025
1582 BB bb 12025 BB bb 12025 BB bb 12025 CC aa 11672 CC aa 11672
1583 CC aa 11672 CC aa 11672 CC bb 10462 CC bb 10462 DD aa 8914
1584 DD aa 8914 DD aa 8914 DD bb 7154 DD bb 7154 DD bb 7154 DD bb 7154
1585 EE aa 6090 EE aa 6090 EE bb 6571 EE bb 6571 EE bb 6571 FF aa 7409
1586 FF aa 7409 FF aa 7409 FF aa 7409 FF bb 8207 FF bb 8207 FF bb 8207
1587 FF bb 8207 FF bb 8207 FF bb 8207 GG aa 8914 GG aa 8914 GG aa 8914
1588 GG aa 8914 GG bb 10136 GG bb 10136 GG bb 10136 GG bb 10136
1589 HH aa 10222 HH aa 10222 HH aa 10222 HH bb 9911 HH bb 9911
1590 HH bb 9911 HH bb 9911 HH bb 9911 HH bb 9911 II aa 9364 II aa 9364
1591 II bb 9083 II bb 9083 II bb 9083 II bb 9083 II bb 9083 JJ aa 8848
1592 JJ aa 8848 JJ aa 8848 JJ aa 8848 JJ bb 7440 JJ bb 7440 JJ bb 7440
1595 do_execsql_test 1.10.3 {
1596 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1597 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
1598 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
1599 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
1600 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
1601 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
1602 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
1603 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
1604 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
1605 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
1606 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
1607 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
1608 JJ bb 73 JJ bb 73 JJ bb 73}
1610 do_execsql_test 1.10.4 {
1611 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1612 } {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 934 AA bb 934
1613 AA bb 934 AA bb 934 BB aa 934 BB aa 934 BB aa 934 BB aa 934
1614 BB aa 934 BB aa 934 BB bb 934 BB bb 934 BB bb 934 BB bb 934
1615 BB bb 934 BB bb 934 CC aa 870 CC aa 870 CC aa 870 CC aa 870
1616 CC bb 840 CC bb 840 DD aa 845 DD aa 845 DD aa 845 DD bb 959
1617 DD bb 959 DD bb 959 DD bb 959 EE aa 959 EE aa 959 EE bb 959
1618 EE bb 959 EE bb 959 FF aa 959 FF aa 959 FF aa 959 FF aa 959
1619 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938
1620 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 938 GG bb 938
1621 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 979
1622 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
1623 II aa 979 II bb 979 II bb 979 II bb 979 II bb 979 II bb 979
1624 JJ aa 963 JJ aa 963 JJ aa 963 JJ aa 963 JJ bb 899 JJ bb 899
1625 JJ bb 899 JJ bb 899}
1627 do_execsql_test 1.10.5 {
1628 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1629 } {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 223 AA bb 223
1630 AA bb 223 AA bb 223 BB aa 223 BB aa 223 BB aa 223 BB aa 223
1631 BB aa 223 BB aa 223 BB bb 223 BB bb 223 BB bb 223 BB bb 223
1632 BB bb 223 BB bb 223 CC aa 158 CC aa 158 CC aa 158 CC aa 158
1633 CC bb 158 CC bb 158 DD aa 158 DD aa 158 DD aa 158 DD bb 158
1634 DD bb 158 DD bb 158 DD bb 158 EE aa 113 EE aa 113 EE bb 113
1635 EE bb 113 EE bb 113 FF aa 113 FF aa 113 FF aa 113 FF aa 113
1636 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
1637 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
1638 GG bb 102 GG bb 102 HH aa 102 HH aa 102 HH aa 102 HH bb 133
1639 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 133
1640 II aa 133 II bb 133 II bb 133 II bb 133 II bb 133 II bb 133
1641 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113
1642 JJ bb 113 JJ bb 113}
1644 do_execsql_test 1.10.6 {
1645 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1646 } {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058
1647 AA bb 4113 AA bb 4376 BB aa 11263 BB aa 11365 BB aa 11613
1648 BB aa 11626 BB aa 11632 BB aa 11778 BB bb 11185 BB bb 11233
1649 BB bb 11239 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 14388
1650 CC aa 14540 CC aa 14717 CC aa 14989 CC bb 14325 CC bb 14801
1651 DD aa 18334 DD aa 18923 DD aa 18955 DD bb 18220 DD bb 18385
1652 DD bb 18463 DD bb 18941 EE aa 16256 EE aa 16920 EE bb 16265
1653 EE bb 16404 EE bb 16781 FF aa 14691 FF aa 14694 FF aa 14743
1654 FF aa 15153 FF bb 14423 FF bb 14491 FF bb 14635 FF bb 14787
1655 FF bb 15066 FF bb 15259 GG aa 16073 GG aa 16227 GG aa 16372
1656 GG aa 16559 GG bb 15769 GG bb 15778 GG bb 15863 GG bb 16547
1657 HH aa 17139 HH aa 17328 HH aa 17638 HH bb 17155 HH bb 17388
1658 HH bb 17435 HH bb 17763 HH bb 17788 HH bb 17985 II aa 18567
1659 II aa 18821 II bb 18414 II bb 18548 II bb 18776 II bb 18798
1660 II bb 18969 JJ aa 16452 JJ aa 16583 JJ aa 17117 JJ aa 17238
1661 JJ bb 16512 JJ bb 16997 JJ bb 17015 JJ bb 17094}
1663 do_execsql_test 1.10.7 {
1664 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1665 } {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 3815 AA bb 4058
1666 AA bb 4113 AA bb 4376 BB aa 6796 BB aa 6898 BB aa 7146 BB aa 7159
1667 BB aa 7165 BB aa 7311 BB bb 11185 BB bb 11233 BB bb 11239
1668 BB bb 11314 BB bb 11320 BB bb 11392 CC aa 10913 CC aa 11065
1669 CC aa 11242 CC aa 11514 CC bb 9640 CC bb 10116 DD aa 8069
1670 DD aa 8658 DD aa 8690 DD bb 6195 DD bb 6360 DD bb 6438 DD bb 6916
1671 EE aa 5313 EE aa 5977 EE bb 5803 EE bb 5942 EE bb 6319 FF aa 6739
1672 FF aa 6742 FF aa 6791 FF aa 7201 FF bb 7269 FF bb 7337 FF bb 7481
1673 FF bb 7633 FF bb 7912 FF bb 8105 GG aa 8280 GG aa 8434 GG aa 8579
1674 GG aa 8766 GG bb 9198 GG bb 9207 GG bb 9292 GG bb 9976 HH aa 9243
1675 HH aa 9432 HH aa 9742 HH bb 8948 HH bb 9181 HH bb 9228 HH bb 9556
1676 HH bb 9581 HH bb 9778 II aa 8712 II aa 8966 II bb 8278 II bb 8412
1677 II bb 8640 II bb 8662 II bb 8833 JJ aa 7949 JJ aa 8080 JJ aa 8614
1678 JJ aa 8735 JJ bb 6601 JJ bb 7086 JJ bb 7104 JJ bb 7183}
1680 do_execsql_test 1.10.8 {
1682 sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW),
1683 sum(c) OVER (ORDER BY a GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING ),
1684 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW),
1685 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 3 PRECEDING AND 0 FOLLOWING )
1686 FROM t3 ORDER BY 1, 2, 3;
1687 } {AA aa 3751 4685 1373 2307 AA aa 3774 4685 1396 2307
1688 AA aa 4446 4685 2068 2307 AA aa 4462 4685 2084 2307
1689 AA bb 3815 4685 3815 4685 AA bb 4058 4685 4058 4685
1690 AA bb 4113 4685 4113 4685 AA bb 4376 4685 4376 4685
1691 BB aa 11263 12025 6796 7558 BB aa 11365 12025 6898 7558
1692 BB aa 11613 12025 7146 7558 BB aa 11626 12025 7159 7558
1693 BB aa 11632 12025 7165 7558 BB aa 11778 12025 7311 7558
1694 BB bb 11185 12025 11185 12025 BB bb 11233 12025 11233 12025
1695 BB bb 11239 12025 11239 12025 BB bb 11314 12025 11314 12025
1696 BB bb 11320 12025 11320 12025 BB bb 11392 12025 11392 12025
1697 CC aa 14388 15147 10913 11672 CC aa 14540 15147 11065 11672
1698 CC aa 14717 15147 11242 11672 CC aa 14989 15147 11514 11672
1699 CC bb 14325 15147 9640 10462 CC bb 14801 15147 10116 10462
1700 DD aa 18334 19179 8069 8914 DD aa 18923 19179 8658 8914
1701 DD aa 18955 19179 8690 8914 DD bb 18220 19179 6195 7154
1702 DD bb 18385 19179 6360 7154 DD bb 18463 19179 6438 7154
1703 DD bb 18941 19179 6916 7154 EE aa 16256 17033 5313 6090
1704 EE aa 16920 17033 5977 6090 EE bb 16265 17033 5803 6571
1705 EE bb 16404 17033 5942 6571 EE bb 16781 17033 6319 6571
1706 FF aa 14691 15361 6739 7409 FF aa 14694 15361 6742 7409
1707 FF aa 14743 15361 6791 7409 FF aa 15153 15361 7201 7409
1708 FF bb 14423 15361 7269 8207 FF bb 14491 15361 7337 8207
1709 FF bb 14635 15361 7481 8207 FF bb 14787 15361 7633 8207
1710 FF bb 15066 15361 7912 8207 FF bb 15259 15361 8105 8207
1711 GG aa 16073 16707 8280 8914 GG aa 16227 16707 8434 8914
1712 GG aa 16372 16707 8579 8914 GG aa 16559 16707 8766 8914
1713 GG bb 15769 16707 9198 10136 GG bb 15778 16707 9207 10136
1714 GG bb 15863 16707 9292 10136 GG bb 16547 16707 9976 10136
1715 HH aa 17139 18118 9243 10222 HH aa 17328 18118 9432 10222
1716 HH aa 17638 18118 9742 10222 HH bb 17155 18118 8948 9911
1717 HH bb 17388 18118 9181 9911 HH bb 17435 18118 9228 9911
1718 HH bb 17763 18118 9556 9911 HH bb 17788 18118 9581 9911
1719 HH bb 17985 18118 9778 9911 II aa 18567 19219 8712 9364
1720 II aa 18821 19219 8966 9364 II bb 18414 19219 8278 9083
1721 II bb 18548 19219 8412 9083 II bb 18776 19219 8640 9083
1722 II bb 18798 19219 8662 9083 II bb 18969 19219 8833 9083
1723 JJ aa 16452 17351 7949 8848 JJ aa 16583 17351 8080 8848
1724 JJ aa 17117 17351 8614 8848 JJ aa 17238 17351 8735 8848
1725 JJ bb 16512 17351 6601 7440 JJ bb 16997 17351 7086 7440
1726 JJ bb 17015 17351 7104 7440 JJ bb 17094 17351 7183 7440}
1728 do_execsql_test 1.11.1 {
1729 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1730 } {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737
1731 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737
1732 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 44737
1733 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737 BB bb 44737
1734 CC aa 44737 CC aa 44737 CC aa 44737 CC aa 44737 CC bb 44737
1735 CC bb 44737 DD aa 40052 DD aa 40052 DD aa 40052 DD bb 40052
1736 DD bb 40052 DD bb 40052 DD bb 40052 EE aa 32712 EE aa 32712
1737 EE bb 32712 EE bb 32712 EE bb 32712 FF aa 29590 FF aa 29590
1738 FF aa 29590 FF aa 29590 FF bb 29590 FF bb 29590 FF bb 29590
1739 FF bb 29590 FF bb 29590 FF bb 29590 GG aa 25558 GG aa 25558
1740 GG aa 25558 GG aa 25558 GG bb 25558 GG bb 25558 GG bb 25558
1741 GG bb 25558 HH aa 23019 HH aa 23019 HH aa 23019 HH bb 23019
1742 HH bb 23019 HH bb 23019 HH bb 23019 HH bb 23019 HH bb 23019
1743 II aa 17351 II aa 17351 II bb 17351 II bb 17351 II bb 17351
1744 II bb 17351 II bb 17351 JJ aa 12883 JJ aa 12883 JJ aa 12883
1745 JJ aa 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883 JJ bb 12883}
1747 do_execsql_test 1.11.2 {
1748 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1749 } {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737
1750 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 44737 BB aa 44737
1751 BB aa 44737 BB aa 44737 BB aa 44737 BB aa 44737 BB bb 42430
1752 BB bb 42430 BB bb 42430 BB bb 42430 BB bb 42430 BB bb 42430
1753 CC aa 40052 CC aa 40052 CC aa 40052 CC aa 40052 CC bb 37179
1754 CC bb 37179 DD aa 32712 DD aa 32712 DD aa 32712 DD bb 30758
1755 DD bb 30758 DD bb 30758 DD bb 30758 EE aa 29590 EE aa 29590
1756 EE bb 28265 EE bb 28265 EE bb 28265 FF aa 25558 FF aa 25558
1757 FF aa 25558 FF aa 25558 FF bb 24668 FF bb 24668 FF bb 24668
1758 FF bb 24668 FF bb 24668 FF bb 24668 GG aa 23019 GG aa 23019
1759 GG aa 23019 GG aa 23019 GG bb 20856 GG bb 20856 GG bb 20856
1760 GG bb 20856 HH aa 17351 HH aa 17351 HH aa 17351 HH bb 15754
1761 HH bb 15754 HH bb 15754 HH bb 15754 HH bb 15754 HH bb 15754
1762 II aa 12883 II aa 12883 II bb 10634 II bb 10634 II bb 10634
1763 II bb 10634 II bb 10634 JJ aa 7440 JJ aa 7440 JJ aa 7440
1764 JJ aa 7440 JJ bb 6390 JJ bb 6390 JJ bb 6390 JJ bb 6390}
1766 do_execsql_test 1.11.3 {
1767 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1768 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
1769 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
1770 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
1771 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
1772 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
1773 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
1774 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
1775 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
1776 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
1777 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
1778 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
1779 JJ bb 73 JJ bb 73 JJ bb 73}
1781 do_execsql_test 1.11.4 {
1782 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1783 } {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979
1784 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979
1785 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979
1786 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979
1787 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979
1788 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979
1789 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979
1790 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979
1791 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979
1792 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 979
1793 HH bb 979 HH bb 979 HH bb 979 HH bb 979 HH bb 979 II aa 979
1794 II aa 979 II bb 963 II bb 963 II bb 963 II bb 963 II bb 963
1795 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 899 JJ bb 899
1796 JJ bb 899 JJ bb 899}
1798 do_execsql_test 1.11.5 {
1799 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1800 } {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102
1801 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102
1802 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102
1803 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102
1804 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102
1805 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102
1806 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102
1807 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
1808 GG aa 102 GG aa 102 GG aa 102 GG aa 102 GG bb 102 GG bb 102
1809 GG bb 102 GG bb 102 HH aa 113 HH aa 113 HH aa 113 HH bb 113
1810 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113
1811 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113
1812 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 113 JJ bb 113
1813 JJ bb 113 JJ bb 113}
1815 do_execsql_test 1.11.6 {
1816 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1817 } {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867
1818 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077
1819 BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 43897
1820 BB bb 43945 BB bb 43951 BB bb 44026 BB bb 44032 BB bb 44104
1821 CC aa 43978 CC aa 44130 CC aa 44307 CC aa 44579 CC bb 43915
1822 CC bb 44391 DD aa 39207 DD aa 39796 DD aa 39828 DD bb 39093
1823 DD bb 39258 DD bb 39336 DD bb 39814 EE aa 31935 EE aa 32599
1824 EE bb 31944 EE bb 32083 EE bb 32460 FF aa 28920 FF aa 28923
1825 FF aa 28972 FF aa 29382 FF bb 28652 FF bb 28720 FF bb 28864
1826 FF bb 29016 FF bb 29295 FF bb 29488 GG aa 24924 GG aa 25078
1827 GG aa 25223 GG aa 25410 GG bb 24620 GG bb 24629 GG bb 24714
1828 GG bb 25398 HH aa 22040 HH aa 22229 HH aa 22539 HH bb 22056
1829 HH bb 22289 HH bb 22336 HH bb 22664 HH bb 22689 HH bb 22886
1830 II aa 16699 II aa 16953 II bb 16546 II bb 16680 II bb 16908
1831 II bb 16930 II bb 17101 JJ aa 11984 JJ aa 12115 JJ aa 12649
1832 JJ aa 12770 JJ bb 12044 JJ bb 12529 JJ bb 12547 JJ bb 12626}
1834 do_execsql_test 1.11.7 {
1835 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1836 } {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867
1837 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 43975 BB aa 44077
1838 BB aa 44325 BB aa 44338 BB aa 44344 BB aa 44490 BB bb 41590
1839 BB bb 41638 BB bb 41644 BB bb 41719 BB bb 41725 BB bb 41797
1840 CC aa 39293 CC aa 39445 CC aa 39622 CC aa 39894 CC bb 36357
1841 CC bb 36833 DD aa 31867 DD aa 32456 DD aa 32488 DD bb 29799
1842 DD bb 29964 DD bb 30042 DD bb 30520 EE aa 28813 EE aa 29477
1843 EE bb 27497 EE bb 27636 EE bb 28013 FF aa 24888 FF aa 24891
1844 FF aa 24940 FF aa 25350 FF bb 23730 FF bb 23798 FF bb 23942
1845 FF bb 24094 FF bb 24373 FF bb 24566 GG aa 22385 GG aa 22539
1846 GG aa 22684 GG aa 22871 GG bb 19918 GG bb 19927 GG bb 20012
1847 GG bb 20696 HH aa 16372 HH aa 16561 HH aa 16871 HH bb 14791
1848 HH bb 15024 HH bb 15071 HH bb 15399 HH bb 15424 HH bb 15621
1849 II aa 12231 II aa 12485 II bb 9829 II bb 9963 II bb 10191
1850 II bb 10213 II bb 10384 JJ aa 6541 JJ aa 6672 JJ aa 7206
1851 JJ aa 7327 JJ bb 5551 JJ bb 6036 JJ bb 6054 JJ bb 6133}
1853 do_execsql_test 1.11.8 {
1855 sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW),
1856 sum(c) OVER (ORDER BY a GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING ),
1857 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW),
1858 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 2 PRECEDING AND UNBOUNDED FOLLOWING )
1859 FROM t3 ORDER BY 1, 2, 3;
1860 } {AA aa 43803 44737 43803 44737 AA aa 43826 44737 43826 44737
1861 AA aa 44498 44737 44498 44737 AA aa 44514 44737 44514 44737
1862 AA bb 43867 44737 43867 44737 AA bb 44110 44737 44110 44737
1863 AA bb 44165 44737 44165 44737 AA bb 44428 44737 44428 44737
1864 BB aa 43975 44737 43975 44737 BB aa 44077 44737 44077 44737
1865 BB aa 44325 44737 44325 44737 BB aa 44338 44737 44338 44737
1866 BB aa 44344 44737 44344 44737 BB aa 44490 44737 44490 44737
1867 BB bb 43897 44737 41590 42430 BB bb 43945 44737 41638 42430
1868 BB bb 43951 44737 41644 42430 BB bb 44026 44737 41719 42430
1869 BB bb 44032 44737 41725 42430 BB bb 44104 44737 41797 42430
1870 CC aa 43978 44737 39293 40052 CC aa 44130 44737 39445 40052
1871 CC aa 44307 44737 39622 40052 CC aa 44579 44737 39894 40052
1872 CC bb 43915 44737 36357 37179 CC bb 44391 44737 36833 37179
1873 DD aa 39207 40052 31867 32712 DD aa 39796 40052 32456 32712
1874 DD aa 39828 40052 32488 32712 DD bb 39093 40052 29799 30758
1875 DD bb 39258 40052 29964 30758 DD bb 39336 40052 30042 30758
1876 DD bb 39814 40052 30520 30758 EE aa 31935 32712 28813 29590
1877 EE aa 32599 32712 29477 29590 EE bb 31944 32712 27497 28265
1878 EE bb 32083 32712 27636 28265 EE bb 32460 32712 28013 28265
1879 FF aa 28920 29590 24888 25558 FF aa 28923 29590 24891 25558
1880 FF aa 28972 29590 24940 25558 FF aa 29382 29590 25350 25558
1881 FF bb 28652 29590 23730 24668 FF bb 28720 29590 23798 24668
1882 FF bb 28864 29590 23942 24668 FF bb 29016 29590 24094 24668
1883 FF bb 29295 29590 24373 24668 FF bb 29488 29590 24566 24668
1884 GG aa 24924 25558 22385 23019 GG aa 25078 25558 22539 23019
1885 GG aa 25223 25558 22684 23019 GG aa 25410 25558 22871 23019
1886 GG bb 24620 25558 19918 20856 GG bb 24629 25558 19927 20856
1887 GG bb 24714 25558 20012 20856 GG bb 25398 25558 20696 20856
1888 HH aa 22040 23019 16372 17351 HH aa 22229 23019 16561 17351
1889 HH aa 22539 23019 16871 17351 HH bb 22056 23019 14791 15754
1890 HH bb 22289 23019 15024 15754 HH bb 22336 23019 15071 15754
1891 HH bb 22664 23019 15399 15754 HH bb 22689 23019 15424 15754
1892 HH bb 22886 23019 15621 15754 II aa 16699 17351 12231 12883
1893 II aa 16953 17351 12485 12883 II bb 16546 17351 9829 10634
1894 II bb 16680 17351 9963 10634 II bb 16908 17351 10191 10634
1895 II bb 16930 17351 10213 10634 II bb 17101 17351 10384 10634
1896 JJ aa 11984 12883 6541 7440 JJ aa 12115 12883 6672 7440
1897 JJ aa 12649 12883 7206 7440 JJ aa 12770 12883 7327 7440
1898 JJ bb 12044 12883 5551 6390 JJ bb 12529 12883 6036 6390
1899 JJ bb 12547 12883 6054 6390 JJ bb 12626 12883 6133 6390}
1901 do_execsql_test 1.12.1 {
1902 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1903 } {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685
1904 AA bb 4685 AA bb 4685 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340
1905 BB aa 7340 BB aa 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340
1906 BB bb 7340 BB bb 7340 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122
1907 CC bb 3122 CC bb 3122 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 4032
1908 DD bb 4032 DD bb 4032 DD bb 4032 EE aa 2539 EE aa 2539 EE bb 2539
1909 EE bb 2539 EE bb 2539 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668
1910 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668
1911 GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 4468 GG bb 4468
1912 GG bb 4468 GG bb 4468 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 5443
1913 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 II aa 3640
1914 II aa 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640
1915 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800
1916 JJ bb 3800 JJ bb 3800}
1918 do_execsql_test 1.12.2 {
1919 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1920 } {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 2378 AA bb 2378
1921 AA bb 2378 AA bb 2378 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873
1922 BB aa 2873 BB aa 2873 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467
1923 BB bb 4467 BB bb 4467 CC aa 1954 CC aa 1954 CC aa 1954 CC aa 1954
1924 CC bb 1168 CC bb 1168 DD aa 1325 DD aa 1325 DD aa 1325 DD bb 2707
1925 DD bb 2707 DD bb 2707 DD bb 2707 EE aa 890 EE aa 890 EE bb 1649
1926 EE bb 1649 EE bb 1649 FF aa 2163 FF aa 2163 FF aa 2163 FF aa 2163
1927 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505
1928 GG aa 1597 GG aa 1597 GG aa 1597 GG aa 1597 GG bb 2871 GG bb 2871
1929 GG bb 2871 GG bb 2871 HH aa 2249 HH aa 2249 HH aa 2249 HH bb 3194
1930 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 II aa 1050
1931 II aa 1050 II bb 2590 II bb 2590 II bb 2590 II bb 2590 II bb 2590
1932 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ bb 1786 JJ bb 1786
1933 JJ bb 1786 JJ bb 1786}
1935 do_execsql_test 1.12.3 {
1936 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1937 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
1938 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
1939 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
1940 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
1941 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
1942 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
1943 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
1944 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
1945 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
1946 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
1947 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
1948 JJ bb 73 JJ bb 73 JJ bb 73}
1950 do_execsql_test 1.12.4 {
1951 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1952 } {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870
1953 AA bb 870 AA bb 870 BB aa 762 BB aa 762 BB aa 762 BB aa 762
1954 BB aa 762 BB aa 762 BB bb 840 BB bb 840 BB bb 840 BB bb 840
1955 BB bb 840 BB bb 840 CC aa 759 CC aa 759 CC aa 759 CC aa 759
1956 CC bb 822 CC bb 822 DD aa 845 DD aa 845 DD aa 845 DD bb 959
1957 DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768
1958 EE bb 768 EE bb 768 FF aa 670 FF aa 670 FF aa 670 FF aa 670
1959 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938
1960 GG aa 634 GG aa 634 GG aa 634 GG aa 634 GG bb 938 GG bb 938
1961 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 963
1962 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 652
1963 II aa 652 II bb 805 II bb 805 II bb 805 II bb 805 II bb 805
1964 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839
1965 JJ bb 839 JJ bb 839}
1967 do_execsql_test 1.12.5 {
1968 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
1969 } {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 309 AA bb 309
1970 AA bb 309 AA bb 309 BB aa 247 BB aa 247 BB aa 247 BB aa 247
1971 BB aa 247 BB aa 247 BB bb 633 BB bb 633 BB bb 633 BB bb 633
1972 BB bb 633 BB bb 633 CC aa 158 CC aa 158 CC aa 158 CC aa 158
1973 CC bb 346 CC bb 346 DD aa 224 DD aa 224 DD aa 224 DD bb 238
1974 DD bb 238 DD bb 238 DD bb 238 EE aa 113 EE aa 113 EE bb 252
1975 EE bb 252 EE bb 252 FF aa 208 FF aa 208 FF aa 208 FF aa 208
1976 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
1977 GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160
1978 GG bb 160 GG bb 160 HH aa 480 HH aa 480 HH aa 480 HH bb 133
1979 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 398
1980 II aa 398 II bb 250 II bb 250 II bb 250 II bb 250 II bb 250
1981 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257
1982 JJ bb 257 JJ bb 257}
1984 do_execsql_test 1.12.6 {
1985 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
1986 } {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058
1987 AA bb 4113 AA bb 4376 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941
1988 BB aa 6947 BB aa 7093 BB bb 6500 BB bb 6548 BB bb 6554 BB bb 6629
1989 BB bb 6635 BB bb 6707 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964
1990 CC bb 2300 CC bb 2776 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 3073
1991 DD bb 3238 DD bb 3316 DD bb 3794 EE aa 1762 EE aa 2426 EE bb 1771
1992 EE bb 1910 EE bb 2287 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460
1993 FF bb 4730 FF bb 4798 FF bb 4942 FF bb 5094 FF bb 5373 FF bb 5566
1994 GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 3530 GG bb 3539
1995 GG bb 3624 GG bb 4308 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 4480
1996 HH bb 4713 HH bb 4760 HH bb 5088 HH bb 5113 HH bb 5310 II aa 2988
1997 II aa 3242 II bb 2835 II bb 2969 II bb 3197 II bb 3219 II bb 3390
1998 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446
1999 JJ bb 3464 JJ bb 3543}
2001 do_execsql_test 1.12.7 {
2002 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2003 } {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 1508 AA bb 1751
2004 AA bb 1806 AA bb 2069 BB aa 2111 BB aa 2213 BB aa 2461 BB aa 2474
2005 BB aa 2480 BB aa 2626 BB bb 3627 BB bb 3675 BB bb 3681 BB bb 3756
2006 BB bb 3762 BB bb 3834 CC aa 1195 CC aa 1347 CC aa 1524 CC aa 1796
2007 CC bb 346 CC bb 822 DD aa 480 DD aa 1069 DD aa 1101 DD bb 1748
2008 DD bb 1913 DD bb 1991 DD bb 2469 EE aa 113 EE aa 777 EE bb 881
2009 EE bb 1020 EE bb 1397 FF aa 1493 FF aa 1496 FF aa 1545 FF aa 1955
2010 FF bb 2567 FF bb 2635 FF bb 2779 FF bb 2931 FF bb 3210 FF bb 3403
2011 GG aa 963 GG aa 1117 GG aa 1262 GG aa 1449 GG bb 1933 GG bb 1942
2012 GG bb 2027 GG bb 2711 HH aa 1270 HH aa 1459 HH aa 1769 HH bb 2231
2013 HH bb 2464 HH bb 2511 HH bb 2839 HH bb 2864 HH bb 3061 II aa 398
2014 II aa 652 II bb 1785 II bb 1919 II bb 2147 II bb 2169 II bb 2340
2015 JJ aa 1115 JJ aa 1246 JJ aa 1780 JJ aa 1901 JJ bb 947 JJ bb 1432
2016 JJ bb 1450 JJ bb 1529}
2018 do_execsql_test 1.12.8 {
2020 sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING EXCLUDE CURRENT ROW),
2021 sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING ),
2022 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING EXCLUDE CURRENT ROW),
2023 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 0 FOLLOWING )
2024 FROM t3 ORDER BY 1, 2, 3;
2025 } {AA aa 3751 4685 1373 2307 AA aa 3774 4685 1396 2307
2026 AA aa 4446 4685 2068 2307 AA aa 4462 4685 2084 2307
2027 AA bb 3815 4685 1508 2378 AA bb 4058 4685 1751 2378
2028 AA bb 4113 4685 1806 2378 AA bb 4376 4685 2069 2378
2029 BB aa 6578 7340 2111 2873 BB aa 6680 7340 2213 2873
2030 BB aa 6928 7340 2461 2873 BB aa 6941 7340 2474 2873
2031 BB aa 6947 7340 2480 2873 BB aa 7093 7340 2626 2873
2032 BB bb 6500 7340 3627 4467 BB bb 6548 7340 3675 4467
2033 BB bb 6554 7340 3681 4467 BB bb 6629 7340 3756 4467
2034 BB bb 6635 7340 3762 4467 BB bb 6707 7340 3834 4467
2035 CC aa 2363 3122 1195 1954 CC aa 2515 3122 1347 1954
2036 CC aa 2692 3122 1524 1954 CC aa 2964 3122 1796 1954
2037 CC bb 2300 3122 346 1168 CC bb 2776 3122 822 1168
2038 DD aa 3187 4032 480 1325 DD aa 3776 4032 1069 1325
2039 DD aa 3808 4032 1101 1325 DD bb 3073 4032 1748 2707
2040 DD bb 3238 4032 1913 2707 DD bb 3316 4032 1991 2707
2041 DD bb 3794 4032 2469 2707 EE aa 1762 2539 113 890
2042 EE aa 2426 2539 777 890 EE bb 1771 2539 881 1649
2043 EE bb 1910 2539 1020 1649 EE bb 2287 2539 1397 1649
2044 FF aa 4998 5668 1493 2163 FF aa 5001 5668 1496 2163
2045 FF aa 5050 5668 1545 2163 FF aa 5460 5668 1955 2163
2046 FF bb 4730 5668 2567 3505 FF bb 4798 5668 2635 3505
2047 FF bb 4942 5668 2779 3505 FF bb 5094 5668 2931 3505
2048 FF bb 5373 5668 3210 3505 FF bb 5566 5668 3403 3505
2049 GG aa 3834 4468 963 1597 GG aa 3988 4468 1117 1597
2050 GG aa 4133 4468 1262 1597 GG aa 4320 4468 1449 1597
2051 GG bb 3530 4468 1933 2871 GG bb 3539 4468 1942 2871
2052 GG bb 3624 4468 2027 2871 GG bb 4308 4468 2711 2871
2053 HH aa 4464 5443 1270 2249 HH aa 4653 5443 1459 2249
2054 HH aa 4963 5443 1769 2249 HH bb 4480 5443 2231 3194
2055 HH bb 4713 5443 2464 3194 HH bb 4760 5443 2511 3194
2056 HH bb 5088 5443 2839 3194 HH bb 5113 5443 2864 3194
2057 HH bb 5310 5443 3061 3194 II aa 2988 3640 398 1050
2058 II aa 3242 3640 652 1050 II bb 2835 3640 1785 2590
2059 II bb 2969 3640 1919 2590 II bb 3197 3640 2147 2590
2060 II bb 3219 3640 2169 2590 II bb 3390 3640 2340 2590
2061 JJ aa 2901 3800 1115 2014 JJ aa 3032 3800 1246 2014
2062 JJ aa 3566 3800 1780 2014 JJ aa 3687 3800 1901 2014
2063 JJ bb 2961 3800 947 1786 JJ bb 3446 3800 1432 1786
2064 JJ bb 3464 3800 1450 1786 JJ bb 3543 3800 1529 1786}
2066 do_execsql_test 1.13.1 {
2067 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2068 } {AA aa 12025 AA aa 12025 AA aa 12025 AA aa 12025 AA bb 12025
2069 AA bb 12025 AA bb 12025 AA bb 12025 BB aa 10462 BB aa 10462
2070 BB aa 10462 BB aa 10462 BB aa 10462 BB aa 10462 BB bb 10462
2071 BB bb 10462 BB bb 10462 BB bb 10462 BB bb 10462 BB bb 10462
2072 CC aa 7154 CC aa 7154 CC aa 7154 CC aa 7154 CC bb 7154 CC bb 7154
2073 DD aa 6571 DD aa 6571 DD aa 6571 DD bb 6571 DD bb 6571 DD bb 6571
2074 DD bb 6571 EE aa 8207 EE aa 8207 EE bb 8207 EE bb 8207 EE bb 8207
2075 FF aa 10136 FF aa 10136 FF aa 10136 FF aa 10136 FF bb 10136
2076 FF bb 10136 FF bb 10136 FF bb 10136 FF bb 10136 FF bb 10136
2077 GG aa 9911 GG aa 9911 GG aa 9911 GG aa 9911 GG bb 9911 GG bb 9911
2078 GG bb 9911 GG bb 9911 HH aa 9083 HH aa 9083 HH aa 9083 HH bb 9083
2079 HH bb 9083 HH bb 9083 HH bb 9083 HH bb 9083 HH bb 9083 II aa 7440
2080 II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440
2081 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800
2082 JJ bb 3800 JJ bb 3800}
2084 do_execsql_test 1.13.2 {
2085 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2086 } {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 5251 AA bb 5251
2087 AA bb 5251 AA bb 5251 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340
2088 BB aa 7340 BB aa 7340 BB bb 6421 BB bb 6421 BB bb 6421 BB bb 6421
2089 BB bb 6421 BB bb 6421 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122
2090 CC bb 2493 CC bb 2493 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 3597
2091 DD bb 3597 DD bb 3597 DD bb 3597 EE aa 2539 EE aa 2539 EE bb 3812
2092 EE bb 3812 EE bb 3812 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668
2093 FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102 FF bb 5102
2094 GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 5120 GG bb 5120
2095 GG bb 5120 GG bb 5120 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 4244
2096 HH bb 4244 HH bb 4244 HH bb 4244 HH bb 4244 HH bb 4244 II aa 3640
2097 II aa 3640 II bb 4604 II bb 4604 II bb 4604 II bb 4604 II bb 4604
2098 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786 JJ bb 1786
2099 JJ bb 1786 JJ bb 1786}
2101 do_execsql_test 1.13.3 {
2102 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2103 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
2104 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
2105 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
2106 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
2107 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
2108 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
2109 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
2110 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
2111 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
2112 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
2113 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
2114 JJ bb 73 JJ bb 73 JJ bb 73}
2116 do_execsql_test 1.13.4 {
2117 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2118 } {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870
2119 AA bb 870 AA bb 870 BB aa 840 BB aa 840 BB aa 840 BB aa 840
2120 BB aa 840 BB aa 840 BB bb 840 BB bb 840 BB bb 840 BB bb 840
2121 BB bb 840 BB bb 840 CC aa 822 CC aa 822 CC aa 822 CC aa 822
2122 CC bb 845 CC bb 845 DD aa 959 DD aa 959 DD aa 959 DD bb 959
2123 DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768
2124 EE bb 768 EE bb 768 FF aa 938 FF aa 938 FF aa 938 FF aa 938
2125 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938
2126 GG aa 938 GG aa 938 GG aa 938 GG aa 938 GG bb 979 GG bb 979
2127 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963
2128 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 805
2129 II aa 805 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899
2130 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839
2131 JJ bb 839 JJ bb 839}
2133 do_execsql_test 1.13.5 {
2134 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2135 } {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 247 AA bb 247
2136 AA bb 247 AA bb 247 BB aa 247 BB aa 247 BB aa 247 BB aa 247
2137 BB aa 247 BB aa 247 BB bb 158 BB bb 158 BB bb 158 BB bb 158
2138 BB bb 158 BB bb 158 CC aa 158 CC aa 158 CC aa 158 CC aa 158
2139 CC bb 224 CC bb 224 DD aa 224 DD aa 224 DD aa 224 DD bb 113
2140 DD bb 113 DD bb 113 DD bb 113 EE aa 113 EE aa 113 EE bb 208
2141 EE bb 208 EE bb 208 FF aa 102 FF aa 102 FF aa 102 FF aa 102
2142 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
2143 GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160
2144 GG bb 160 GG bb 160 HH aa 133 HH aa 133 HH aa 133 HH bb 133
2145 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 250
2146 II aa 250 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113
2147 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257
2148 JJ bb 257 JJ bb 257}
2150 do_execsql_test 1.13.6 {
2151 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2152 } {AA aa 11091 AA aa 11114 AA aa 11786 AA aa 11802 AA bb 11155
2153 AA bb 11398 AA bb 11453 AA bb 11716 BB aa 9700 BB aa 9802
2154 BB aa 10050 BB aa 10063 BB aa 10069 BB aa 10215 BB bb 9622
2155 BB bb 9670 BB bb 9676 BB bb 9751 BB bb 9757 BB bb 9829 CC aa 6395
2156 CC aa 6547 CC aa 6724 CC aa 6996 CC bb 6332 CC bb 6808 DD aa 5726
2157 DD aa 6315 DD aa 6347 DD bb 5612 DD bb 5777 DD bb 5855 DD bb 6333
2158 EE aa 7430 EE aa 8094 EE bb 7439 EE bb 7578 EE bb 7955 FF aa 9466
2159 FF aa 9469 FF aa 9518 FF aa 9928 FF bb 9198 FF bb 9266 FF bb 9410
2160 FF bb 9562 FF bb 9841 FF bb 10034 GG aa 9277 GG aa 9431
2161 GG aa 9576 GG aa 9763 GG bb 8973 GG bb 8982 GG bb 9067 GG bb 9751
2162 HH aa 8104 HH aa 8293 HH aa 8603 HH bb 8120 HH bb 8353 HH bb 8400
2163 HH bb 8728 HH bb 8753 HH bb 8950 II aa 6788 II aa 7042 II bb 6635
2164 II bb 6769 II bb 6997 II bb 7019 II bb 7190 JJ aa 2901 JJ aa 3032
2165 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446 JJ bb 3464 JJ bb 3543}
2167 do_execsql_test 1.13.7 {
2168 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2169 } {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 4381 AA bb 4624
2170 AA bb 4679 AA bb 4942 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941
2171 BB aa 6947 BB aa 7093 BB bb 5581 BB bb 5629 BB bb 5635 BB bb 5710
2172 BB bb 5716 BB bb 5788 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964
2173 CC bb 1671 CC bb 2147 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 2638
2174 DD bb 2803 DD bb 2881 DD bb 3359 EE aa 1762 EE aa 2426 EE bb 3044
2175 EE bb 3183 EE bb 3560 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460
2176 FF bb 4164 FF bb 4232 FF bb 4376 FF bb 4528 FF bb 4807 FF bb 5000
2177 GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 4182 GG bb 4191
2178 GG bb 4276 GG bb 4960 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 3281
2179 HH bb 3514 HH bb 3561 HH bb 3889 HH bb 3914 HH bb 4111 II aa 2988
2180 II aa 3242 II bb 3799 II bb 3933 II bb 4161 II bb 4183 II bb 4354
2181 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947 JJ bb 1432
2182 JJ bb 1450 JJ bb 1529}
2184 do_execsql_test 1.13.8 {
2186 sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING EXCLUDE CURRENT ROW),
2187 sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING ),
2188 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING EXCLUDE CURRENT ROW),
2189 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 1 FOLLOWING )
2190 FROM t3 ORDER BY 1, 2, 3;
2191 } {AA aa 11091 12025 3751 4685 AA aa 11114 12025 3774 4685
2192 AA aa 11786 12025 4446 4685 AA aa 11802 12025 4462 4685
2193 AA bb 11155 12025 4381 5251 AA bb 11398 12025 4624 5251
2194 AA bb 11453 12025 4679 5251 AA bb 11716 12025 4942 5251
2195 BB aa 9700 10462 6578 7340 BB aa 9802 10462 6680 7340
2196 BB aa 10050 10462 6928 7340 BB aa 10063 10462 6941 7340
2197 BB aa 10069 10462 6947 7340 BB aa 10215 10462 7093 7340
2198 BB bb 9622 10462 5581 6421 BB bb 9670 10462 5629 6421
2199 BB bb 9676 10462 5635 6421 BB bb 9751 10462 5710 6421
2200 BB bb 9757 10462 5716 6421 BB bb 9829 10462 5788 6421
2201 CC aa 6395 7154 2363 3122 CC aa 6547 7154 2515 3122
2202 CC aa 6724 7154 2692 3122 CC aa 6996 7154 2964 3122
2203 CC bb 6332 7154 1671 2493 CC bb 6808 7154 2147 2493
2204 DD aa 5726 6571 3187 4032 DD aa 6315 6571 3776 4032
2205 DD aa 6347 6571 3808 4032 DD bb 5612 6571 2638 3597
2206 DD bb 5777 6571 2803 3597 DD bb 5855 6571 2881 3597
2207 DD bb 6333 6571 3359 3597 EE aa 7430 8207 1762 2539
2208 EE aa 8094 8207 2426 2539 EE bb 7439 8207 3044 3812
2209 EE bb 7578 8207 3183 3812 EE bb 7955 8207 3560 3812
2210 FF aa 9466 10136 4998 5668 FF aa 9469 10136 5001 5668
2211 FF aa 9518 10136 5050 5668 FF aa 9928 10136 5460 5668
2212 FF bb 9198 10136 4164 5102 FF bb 9266 10136 4232 5102
2213 FF bb 9410 10136 4376 5102 FF bb 9562 10136 4528 5102
2214 FF bb 9841 10136 4807 5102 FF bb 10034 10136 5000 5102
2215 GG aa 9277 9911 3834 4468 GG aa 9431 9911 3988 4468
2216 GG aa 9576 9911 4133 4468 GG aa 9763 9911 4320 4468
2217 GG bb 8973 9911 4182 5120 GG bb 8982 9911 4191 5120
2218 GG bb 9067 9911 4276 5120 GG bb 9751 9911 4960 5120
2219 HH aa 8104 9083 4464 5443 HH aa 8293 9083 4653 5443
2220 HH aa 8603 9083 4963 5443 HH bb 8120 9083 3281 4244
2221 HH bb 8353 9083 3514 4244 HH bb 8400 9083 3561 4244
2222 HH bb 8728 9083 3889 4244 HH bb 8753 9083 3914 4244
2223 HH bb 8950 9083 4111 4244 II aa 6788 7440 2988 3640
2224 II aa 7042 7440 3242 3640 II bb 6635 7440 3799 4604
2225 II bb 6769 7440 3933 4604 II bb 6997 7440 4161 4604
2226 II bb 7019 7440 4183 4604 II bb 7190 7440 4354 4604
2227 JJ aa 2901 3800 2901 3800 JJ aa 3032 3800 3032 3800
2228 JJ aa 3566 3800 3566 3800 JJ aa 3687 3800 3687 3800
2229 JJ bb 2961 3800 947 1786 JJ bb 3446 3800 1432 1786
2230 JJ bb 3464 3800 1450 1786 JJ bb 3543 3800 1529 1786}
2232 do_execsql_test 1.14.1 {
2233 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2234 } {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737
2235 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 40052 BB aa 40052
2236 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 40052
2237 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052
2238 CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 32712
2239 CC bb 32712 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 29590
2240 DD bb 29590 DD bb 29590 DD bb 29590 EE aa 25558 EE aa 25558
2241 EE bb 25558 EE bb 25558 EE bb 25558 FF aa 23019 FF aa 23019
2242 FF aa 23019 FF aa 23019 FF bb 23019 FF bb 23019 FF bb 23019
2243 FF bb 23019 FF bb 23019 FF bb 23019 GG aa 17351 GG aa 17351
2244 GG aa 17351 GG aa 17351 GG bb 17351 GG bb 17351 GG bb 17351
2245 GG bb 17351 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 12883
2246 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883
2247 II aa 7440 II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440
2248 II bb 7440 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800
2249 JJ bb 3800 JJ bb 3800 JJ bb 3800}
2251 do_execsql_test 1.14.2 {
2252 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2253 } {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 42430
2254 AA bb 42430 AA bb 42430 AA bb 42430 BB aa 40052 BB aa 40052
2255 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 37179
2256 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179
2257 CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 30758
2258 CC bb 30758 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 28265
2259 DD bb 28265 DD bb 28265 DD bb 28265 EE aa 25558 EE aa 25558
2260 EE bb 24668 EE bb 24668 EE bb 24668 FF aa 23019 FF aa 23019
2261 FF aa 23019 FF aa 23019 FF bb 20856 FF bb 20856 FF bb 20856
2262 FF bb 20856 FF bb 20856 FF bb 20856 GG aa 17351 GG aa 17351
2263 GG aa 17351 GG aa 17351 GG bb 15754 GG bb 15754 GG bb 15754
2264 GG bb 15754 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 10634
2265 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634
2266 II aa 7440 II aa 7440 II bb 6390 II bb 6390 II bb 6390 II bb 6390
2267 II bb 6390 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786
2268 JJ bb 1786 JJ bb 1786 JJ bb 1786}
2270 do_execsql_test 1.14.3 {
2271 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2272 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
2273 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
2274 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
2275 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
2276 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
2277 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
2278 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
2279 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
2280 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
2281 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
2282 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
2283 JJ bb 73 JJ bb 73 JJ bb 73}
2285 do_execsql_test 1.14.4 {
2286 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2287 } {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979
2288 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979
2289 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979
2290 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979
2291 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979
2292 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979
2293 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979
2294 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979
2295 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979
2296 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963
2297 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 899
2298 II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899
2299 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839
2300 JJ bb 839 JJ bb 839}
2302 do_execsql_test 1.14.5 {
2303 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2304 } {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102
2305 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102
2306 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102
2307 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102
2308 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102
2309 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102
2310 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102
2311 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
2312 GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113
2313 GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113
2314 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113
2315 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113
2316 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257
2317 JJ bb 257 JJ bb 257}
2319 do_execsql_test 1.14.6 {
2320 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2321 } {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867
2322 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 39290 BB aa 39392
2323 BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 39212
2324 BB bb 39260 BB bb 39266 BB bb 39341 BB bb 39347 BB bb 39419
2325 CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 31890
2326 CC bb 32366 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 28631
2327 DD bb 28796 DD bb 28874 DD bb 29352 EE aa 24781 EE aa 25445
2328 EE bb 24790 EE bb 24929 EE bb 25306 FF aa 22349 FF aa 22352
2329 FF aa 22401 FF aa 22811 FF bb 22081 FF bb 22149 FF bb 22293
2330 FF bb 22445 FF bb 22724 FF bb 22917 GG aa 16717 GG aa 16871
2331 GG aa 17016 GG aa 17203 GG bb 16413 GG bb 16422 GG bb 16507
2332 GG bb 17191 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 11920
2333 HH bb 12153 HH bb 12200 HH bb 12528 HH bb 12553 HH bb 12750
2334 II aa 6788 II aa 7042 II bb 6635 II bb 6769 II bb 6997 II bb 7019
2335 II bb 7190 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961
2336 JJ bb 3446 JJ bb 3464 JJ bb 3543}
2338 do_execsql_test 1.14.7 {
2339 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2340 } {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 41560
2341 AA bb 41803 AA bb 41858 AA bb 42121 BB aa 39290 BB aa 39392
2342 BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 36339
2343 BB bb 36387 BB bb 36393 BB bb 36468 BB bb 36474 BB bb 36546
2344 CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 29936
2345 CC bb 30412 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 27306
2346 DD bb 27471 DD bb 27549 DD bb 28027 EE aa 24781 EE aa 25445
2347 EE bb 23900 EE bb 24039 EE bb 24416 FF aa 22349 FF aa 22352
2348 FF aa 22401 FF aa 22811 FF bb 19918 FF bb 19986 FF bb 20130
2349 FF bb 20282 FF bb 20561 FF bb 20754 GG aa 16717 GG aa 16871
2350 GG aa 17016 GG aa 17203 GG bb 14816 GG bb 14825 GG bb 14910
2351 GG bb 15594 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 9671
2352 HH bb 9904 HH bb 9951 HH bb 10279 HH bb 10304 HH bb 10501
2353 II aa 6788 II aa 7042 II bb 5585 II bb 5719 II bb 5947 II bb 5969
2354 II bb 6140 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947
2355 JJ bb 1432 JJ bb 1450 JJ bb 1529}
2357 do_execsql_test 1.14.8 {
2359 sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING EXCLUDE CURRENT ROW),
2360 sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING ),
2361 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING EXCLUDE CURRENT ROW),
2362 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND 100 FOLLOWING )
2363 FROM t3 ORDER BY 1, 2, 3;
2364 } {AA aa 43803 44737 43803 44737 AA aa 43826 44737 43826 44737
2365 AA aa 44498 44737 44498 44737 AA aa 44514 44737 44514 44737
2366 AA bb 43867 44737 41560 42430 AA bb 44110 44737 41803 42430
2367 AA bb 44165 44737 41858 42430 AA bb 44428 44737 42121 42430
2368 BB aa 39290 40052 39290 40052 BB aa 39392 40052 39392 40052
2369 BB aa 39640 40052 39640 40052 BB aa 39653 40052 39653 40052
2370 BB aa 39659 40052 39659 40052 BB aa 39805 40052 39805 40052
2371 BB bb 39212 40052 36339 37179 BB bb 39260 40052 36387 37179
2372 BB bb 39266 40052 36393 37179 BB bb 39341 40052 36468 37179
2373 BB bb 39347 40052 36474 37179 BB bb 39419 40052 36546 37179
2374 CC aa 31953 32712 31953 32712 CC aa 32105 32712 32105 32712
2375 CC aa 32282 32712 32282 32712 CC aa 32554 32712 32554 32712
2376 CC bb 31890 32712 29936 30758 CC bb 32366 32712 30412 30758
2377 DD aa 28745 29590 28745 29590 DD aa 29334 29590 29334 29590
2378 DD aa 29366 29590 29366 29590 DD bb 28631 29590 27306 28265
2379 DD bb 28796 29590 27471 28265 DD bb 28874 29590 27549 28265
2380 DD bb 29352 29590 28027 28265 EE aa 24781 25558 24781 25558
2381 EE aa 25445 25558 25445 25558 EE bb 24790 25558 23900 24668
2382 EE bb 24929 25558 24039 24668 EE bb 25306 25558 24416 24668
2383 FF aa 22349 23019 22349 23019 FF aa 22352 23019 22352 23019
2384 FF aa 22401 23019 22401 23019 FF aa 22811 23019 22811 23019
2385 FF bb 22081 23019 19918 20856 FF bb 22149 23019 19986 20856
2386 FF bb 22293 23019 20130 20856 FF bb 22445 23019 20282 20856
2387 FF bb 22724 23019 20561 20856 FF bb 22917 23019 20754 20856
2388 GG aa 16717 17351 16717 17351 GG aa 16871 17351 16871 17351
2389 GG aa 17016 17351 17016 17351 GG aa 17203 17351 17203 17351
2390 GG bb 16413 17351 14816 15754 GG bb 16422 17351 14825 15754
2391 GG bb 16507 17351 14910 15754 GG bb 17191 17351 15594 15754
2392 HH aa 11904 12883 11904 12883 HH aa 12093 12883 12093 12883
2393 HH aa 12403 12883 12403 12883 HH bb 11920 12883 9671 10634
2394 HH bb 12153 12883 9904 10634 HH bb 12200 12883 9951 10634
2395 HH bb 12528 12883 10279 10634 HH bb 12553 12883 10304 10634
2396 HH bb 12750 12883 10501 10634 II aa 6788 7440 6788 7440
2397 II aa 7042 7440 7042 7440 II bb 6635 7440 5585 6390
2398 II bb 6769 7440 5719 6390 II bb 6997 7440 5947 6390
2399 II bb 7019 7440 5969 6390 II bb 7190 7440 6140 6390
2400 JJ aa 2901 3800 2901 3800 JJ aa 3032 3800 3032 3800
2401 JJ aa 3566 3800 3566 3800 JJ aa 3687 3800 3687 3800
2402 JJ bb 2961 3800 947 1786 JJ bb 3446 3800 1432 1786
2403 JJ bb 3464 3800 1450 1786 JJ bb 3543 3800 1529 1786}
2405 do_execsql_test 1.15.1 {
2406 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2407 } {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 44737
2408 AA bb 44737 AA bb 44737 AA bb 44737 BB aa 40052 BB aa 40052
2409 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 40052
2410 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052 BB bb 40052
2411 CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 32712
2412 CC bb 32712 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 29590
2413 DD bb 29590 DD bb 29590 DD bb 29590 EE aa 25558 EE aa 25558
2414 EE bb 25558 EE bb 25558 EE bb 25558 FF aa 23019 FF aa 23019
2415 FF aa 23019 FF aa 23019 FF bb 23019 FF bb 23019 FF bb 23019
2416 FF bb 23019 FF bb 23019 FF bb 23019 GG aa 17351 GG aa 17351
2417 GG aa 17351 GG aa 17351 GG bb 17351 GG bb 17351 GG bb 17351
2418 GG bb 17351 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 12883
2419 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883 HH bb 12883
2420 II aa 7440 II aa 7440 II bb 7440 II bb 7440 II bb 7440 II bb 7440
2421 II bb 7440 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800
2422 JJ bb 3800 JJ bb 3800 JJ bb 3800}
2424 do_execsql_test 1.15.2 {
2425 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2426 } {AA aa 44737 AA aa 44737 AA aa 44737 AA aa 44737 AA bb 42430
2427 AA bb 42430 AA bb 42430 AA bb 42430 BB aa 40052 BB aa 40052
2428 BB aa 40052 BB aa 40052 BB aa 40052 BB aa 40052 BB bb 37179
2429 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179 BB bb 37179
2430 CC aa 32712 CC aa 32712 CC aa 32712 CC aa 32712 CC bb 30758
2431 CC bb 30758 DD aa 29590 DD aa 29590 DD aa 29590 DD bb 28265
2432 DD bb 28265 DD bb 28265 DD bb 28265 EE aa 25558 EE aa 25558
2433 EE bb 24668 EE bb 24668 EE bb 24668 FF aa 23019 FF aa 23019
2434 FF aa 23019 FF aa 23019 FF bb 20856 FF bb 20856 FF bb 20856
2435 FF bb 20856 FF bb 20856 FF bb 20856 GG aa 17351 GG aa 17351
2436 GG aa 17351 GG aa 17351 GG bb 15754 GG bb 15754 GG bb 15754
2437 GG bb 15754 HH aa 12883 HH aa 12883 HH aa 12883 HH bb 10634
2438 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634 HH bb 10634
2439 II aa 7440 II aa 7440 II bb 6390 II bb 6390 II bb 6390 II bb 6390
2440 II bb 6390 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 1786
2441 JJ bb 1786 JJ bb 1786 JJ bb 1786}
2443 do_execsql_test 1.15.3 {
2444 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2445 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
2446 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
2447 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
2448 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
2449 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
2450 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
2451 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
2452 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
2453 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
2454 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
2455 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
2456 JJ bb 73 JJ bb 73 JJ bb 73}
2458 do_execsql_test 1.15.4 {
2459 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2460 } {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979
2461 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979
2462 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979
2463 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979
2464 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979
2465 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979
2466 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979
2467 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979
2468 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979
2469 GG bb 979 GG bb 979 HH aa 979 HH aa 979 HH aa 979 HH bb 963
2470 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 899
2471 II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899
2472 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839
2473 JJ bb 839 JJ bb 839}
2475 do_execsql_test 1.15.5 {
2476 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2477 } {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102
2478 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102
2479 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102
2480 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102
2481 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102
2482 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102
2483 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102
2484 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
2485 GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113
2486 GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113
2487 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113
2488 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113
2489 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257
2490 JJ bb 257 JJ bb 257}
2492 do_execsql_test 1.15.6 {
2493 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2494 } {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 43867
2495 AA bb 44110 AA bb 44165 AA bb 44428 BB aa 39290 BB aa 39392
2496 BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 39212
2497 BB bb 39260 BB bb 39266 BB bb 39341 BB bb 39347 BB bb 39419
2498 CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 31890
2499 CC bb 32366 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 28631
2500 DD bb 28796 DD bb 28874 DD bb 29352 EE aa 24781 EE aa 25445
2501 EE bb 24790 EE bb 24929 EE bb 25306 FF aa 22349 FF aa 22352
2502 FF aa 22401 FF aa 22811 FF bb 22081 FF bb 22149 FF bb 22293
2503 FF bb 22445 FF bb 22724 FF bb 22917 GG aa 16717 GG aa 16871
2504 GG aa 17016 GG aa 17203 GG bb 16413 GG bb 16422 GG bb 16507
2505 GG bb 17191 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 11920
2506 HH bb 12153 HH bb 12200 HH bb 12528 HH bb 12553 HH bb 12750
2507 II aa 6788 II aa 7042 II bb 6635 II bb 6769 II bb 6997 II bb 7019
2508 II bb 7190 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961
2509 JJ bb 3446 JJ bb 3464 JJ bb 3543}
2511 do_execsql_test 1.15.7 {
2512 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2513 } {AA aa 43803 AA aa 43826 AA aa 44498 AA aa 44514 AA bb 41560
2514 AA bb 41803 AA bb 41858 AA bb 42121 BB aa 39290 BB aa 39392
2515 BB aa 39640 BB aa 39653 BB aa 39659 BB aa 39805 BB bb 36339
2516 BB bb 36387 BB bb 36393 BB bb 36468 BB bb 36474 BB bb 36546
2517 CC aa 31953 CC aa 32105 CC aa 32282 CC aa 32554 CC bb 29936
2518 CC bb 30412 DD aa 28745 DD aa 29334 DD aa 29366 DD bb 27306
2519 DD bb 27471 DD bb 27549 DD bb 28027 EE aa 24781 EE aa 25445
2520 EE bb 23900 EE bb 24039 EE bb 24416 FF aa 22349 FF aa 22352
2521 FF aa 22401 FF aa 22811 FF bb 19918 FF bb 19986 FF bb 20130
2522 FF bb 20282 FF bb 20561 FF bb 20754 GG aa 16717 GG aa 16871
2523 GG aa 17016 GG aa 17203 GG bb 14816 GG bb 14825 GG bb 14910
2524 GG bb 15594 HH aa 11904 HH aa 12093 HH aa 12403 HH bb 9671
2525 HH bb 9904 HH bb 9951 HH bb 10279 HH bb 10304 HH bb 10501
2526 II aa 6788 II aa 7042 II bb 5585 II bb 5719 II bb 5947 II bb 5969
2527 II bb 6140 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 947
2528 JJ bb 1432 JJ bb 1450 JJ bb 1529}
2530 do_execsql_test 1.15.8 {
2532 sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW),
2533 sum(c) OVER (ORDER BY a GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ),
2534 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW),
2535 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING )
2536 FROM t3 ORDER BY 1, 2, 3;
2537 } {AA aa 43803 44737 43803 44737 AA aa 43826 44737 43826 44737
2538 AA aa 44498 44737 44498 44737 AA aa 44514 44737 44514 44737
2539 AA bb 43867 44737 41560 42430 AA bb 44110 44737 41803 42430
2540 AA bb 44165 44737 41858 42430 AA bb 44428 44737 42121 42430
2541 BB aa 39290 40052 39290 40052 BB aa 39392 40052 39392 40052
2542 BB aa 39640 40052 39640 40052 BB aa 39653 40052 39653 40052
2543 BB aa 39659 40052 39659 40052 BB aa 39805 40052 39805 40052
2544 BB bb 39212 40052 36339 37179 BB bb 39260 40052 36387 37179
2545 BB bb 39266 40052 36393 37179 BB bb 39341 40052 36468 37179
2546 BB bb 39347 40052 36474 37179 BB bb 39419 40052 36546 37179
2547 CC aa 31953 32712 31953 32712 CC aa 32105 32712 32105 32712
2548 CC aa 32282 32712 32282 32712 CC aa 32554 32712 32554 32712
2549 CC bb 31890 32712 29936 30758 CC bb 32366 32712 30412 30758
2550 DD aa 28745 29590 28745 29590 DD aa 29334 29590 29334 29590
2551 DD aa 29366 29590 29366 29590 DD bb 28631 29590 27306 28265
2552 DD bb 28796 29590 27471 28265 DD bb 28874 29590 27549 28265
2553 DD bb 29352 29590 28027 28265 EE aa 24781 25558 24781 25558
2554 EE aa 25445 25558 25445 25558 EE bb 24790 25558 23900 24668
2555 EE bb 24929 25558 24039 24668 EE bb 25306 25558 24416 24668
2556 FF aa 22349 23019 22349 23019 FF aa 22352 23019 22352 23019
2557 FF aa 22401 23019 22401 23019 FF aa 22811 23019 22811 23019
2558 FF bb 22081 23019 19918 20856 FF bb 22149 23019 19986 20856
2559 FF bb 22293 23019 20130 20856 FF bb 22445 23019 20282 20856
2560 FF bb 22724 23019 20561 20856 FF bb 22917 23019 20754 20856
2561 GG aa 16717 17351 16717 17351 GG aa 16871 17351 16871 17351
2562 GG aa 17016 17351 17016 17351 GG aa 17203 17351 17203 17351
2563 GG bb 16413 17351 14816 15754 GG bb 16422 17351 14825 15754
2564 GG bb 16507 17351 14910 15754 GG bb 17191 17351 15594 15754
2565 HH aa 11904 12883 11904 12883 HH aa 12093 12883 12093 12883
2566 HH aa 12403 12883 12403 12883 HH bb 11920 12883 9671 10634
2567 HH bb 12153 12883 9904 10634 HH bb 12200 12883 9951 10634
2568 HH bb 12528 12883 10279 10634 HH bb 12553 12883 10304 10634
2569 HH bb 12750 12883 10501 10634 II aa 6788 7440 6788 7440
2570 II aa 7042 7440 7042 7440 II bb 6635 7440 5585 6390
2571 II bb 6769 7440 5719 6390 II bb 6997 7440 5947 6390
2572 II bb 7019 7440 5969 6390 II bb 7190 7440 6140 6390
2573 JJ aa 2901 3800 2901 3800 JJ aa 3032 3800 3032 3800
2574 JJ aa 3566 3800 3566 3800 JJ aa 3687 3800 3687 3800
2575 JJ bb 2961 3800 947 1786 JJ bb 3446 3800 1432 1786
2576 JJ bb 3464 3800 1450 1786 JJ bb 3543 3800 1529 1786}
2578 do_execsql_test 1.16.1 {
2579 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2580 } {AA aa 4685 AA aa 4685 AA aa 4685 AA aa 4685 AA bb 4685 AA bb 4685
2581 AA bb 4685 AA bb 4685 BB aa 7340 BB aa 7340 BB aa 7340 BB aa 7340
2582 BB aa 7340 BB aa 7340 BB bb 7340 BB bb 7340 BB bb 7340 BB bb 7340
2583 BB bb 7340 BB bb 7340 CC aa 3122 CC aa 3122 CC aa 3122 CC aa 3122
2584 CC bb 3122 CC bb 3122 DD aa 4032 DD aa 4032 DD aa 4032 DD bb 4032
2585 DD bb 4032 DD bb 4032 DD bb 4032 EE aa 2539 EE aa 2539 EE bb 2539
2586 EE bb 2539 EE bb 2539 FF aa 5668 FF aa 5668 FF aa 5668 FF aa 5668
2587 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668 FF bb 5668
2588 GG aa 4468 GG aa 4468 GG aa 4468 GG aa 4468 GG bb 4468 GG bb 4468
2589 GG bb 4468 GG bb 4468 HH aa 5443 HH aa 5443 HH aa 5443 HH bb 5443
2590 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 HH bb 5443 II aa 3640
2591 II aa 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640 II bb 3640
2592 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ aa 3800 JJ bb 3800 JJ bb 3800
2593 JJ bb 3800 JJ bb 3800}
2595 do_execsql_test 1.16.2 {
2596 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2597 } {AA aa 2307 AA aa 2307 AA aa 2307 AA aa 2307 AA bb 2378 AA bb 2378
2598 AA bb 2378 AA bb 2378 BB aa 2873 BB aa 2873 BB aa 2873 BB aa 2873
2599 BB aa 2873 BB aa 2873 BB bb 4467 BB bb 4467 BB bb 4467 BB bb 4467
2600 BB bb 4467 BB bb 4467 CC aa 1954 CC aa 1954 CC aa 1954 CC aa 1954
2601 CC bb 1168 CC bb 1168 DD aa 1325 DD aa 1325 DD aa 1325 DD bb 2707
2602 DD bb 2707 DD bb 2707 DD bb 2707 EE aa 890 EE aa 890 EE bb 1649
2603 EE bb 1649 EE bb 1649 FF aa 2163 FF aa 2163 FF aa 2163 FF aa 2163
2604 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505 FF bb 3505
2605 GG aa 1597 GG aa 1597 GG aa 1597 GG aa 1597 GG bb 2871 GG bb 2871
2606 GG bb 2871 GG bb 2871 HH aa 2249 HH aa 2249 HH aa 2249 HH bb 3194
2607 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 HH bb 3194 II aa 1050
2608 II aa 1050 II bb 2590 II bb 2590 II bb 2590 II bb 2590 II bb 2590
2609 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ aa 2014 JJ bb 1786 JJ bb 1786
2610 JJ bb 1786 JJ bb 1786}
2612 do_execsql_test 1.16.3 {
2613 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2614 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
2615 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
2616 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
2617 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
2618 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
2619 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
2620 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
2621 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
2622 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
2623 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
2624 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
2625 JJ bb 73 JJ bb 73 JJ bb 73}
2627 do_execsql_test 1.16.4 {
2628 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2629 } {AA aa 934 AA aa 934 AA aa 934 AA aa 934 AA bb 870 AA bb 870
2630 AA bb 870 AA bb 870 BB aa 762 BB aa 762 BB aa 762 BB aa 762
2631 BB aa 762 BB aa 762 BB bb 840 BB bb 840 BB bb 840 BB bb 840
2632 BB bb 840 BB bb 840 CC aa 759 CC aa 759 CC aa 759 CC aa 759
2633 CC bb 822 CC bb 822 DD aa 845 DD aa 845 DD aa 845 DD bb 959
2634 DD bb 959 DD bb 959 DD bb 959 EE aa 777 EE aa 777 EE bb 768
2635 EE bb 768 EE bb 768 FF aa 670 FF aa 670 FF aa 670 FF aa 670
2636 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938 FF bb 938
2637 GG aa 634 GG aa 634 GG aa 634 GG aa 634 GG bb 938 GG bb 938
2638 GG bb 938 GG bb 938 HH aa 979 HH aa 979 HH aa 979 HH bb 963
2639 HH bb 963 HH bb 963 HH bb 963 HH bb 963 HH bb 963 II aa 652
2640 II aa 652 II bb 805 II bb 805 II bb 805 II bb 805 II bb 805
2641 JJ aa 899 JJ aa 899 JJ aa 899 JJ aa 899 JJ bb 839 JJ bb 839
2642 JJ bb 839 JJ bb 839}
2644 do_execsql_test 1.16.5 {
2645 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2646 } {AA aa 223 AA aa 223 AA aa 223 AA aa 223 AA bb 309 AA bb 309
2647 AA bb 309 AA bb 309 BB aa 247 BB aa 247 BB aa 247 BB aa 247
2648 BB aa 247 BB aa 247 BB bb 633 BB bb 633 BB bb 633 BB bb 633
2649 BB bb 633 BB bb 633 CC aa 158 CC aa 158 CC aa 158 CC aa 158
2650 CC bb 346 CC bb 346 DD aa 224 DD aa 224 DD aa 224 DD bb 238
2651 DD bb 238 DD bb 238 DD bb 238 EE aa 113 EE aa 113 EE bb 252
2652 EE bb 252 EE bb 252 FF aa 208 FF aa 208 FF aa 208 FF aa 208
2653 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102 FF bb 102
2654 GG aa 148 GG aa 148 GG aa 148 GG aa 148 GG bb 160 GG bb 160
2655 GG bb 160 GG bb 160 HH aa 480 HH aa 480 HH aa 480 HH bb 133
2656 HH bb 133 HH bb 133 HH bb 133 HH bb 133 HH bb 133 II aa 398
2657 II aa 398 II bb 250 II bb 250 II bb 250 II bb 250 II bb 250
2658 JJ aa 113 JJ aa 113 JJ aa 113 JJ aa 113 JJ bb 257 JJ bb 257
2659 JJ bb 257 JJ bb 257}
2661 do_execsql_test 1.16.6 {
2662 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2663 } {AA aa 3751 AA aa 3774 AA aa 4446 AA aa 4462 AA bb 3815 AA bb 4058
2664 AA bb 4113 AA bb 4376 BB aa 6578 BB aa 6680 BB aa 6928 BB aa 6941
2665 BB aa 6947 BB aa 7093 BB bb 6500 BB bb 6548 BB bb 6554 BB bb 6629
2666 BB bb 6635 BB bb 6707 CC aa 2363 CC aa 2515 CC aa 2692 CC aa 2964
2667 CC bb 2300 CC bb 2776 DD aa 3187 DD aa 3776 DD aa 3808 DD bb 3073
2668 DD bb 3238 DD bb 3316 DD bb 3794 EE aa 1762 EE aa 2426 EE bb 1771
2669 EE bb 1910 EE bb 2287 FF aa 4998 FF aa 5001 FF aa 5050 FF aa 5460
2670 FF bb 4730 FF bb 4798 FF bb 4942 FF bb 5094 FF bb 5373 FF bb 5566
2671 GG aa 3834 GG aa 3988 GG aa 4133 GG aa 4320 GG bb 3530 GG bb 3539
2672 GG bb 3624 GG bb 4308 HH aa 4464 HH aa 4653 HH aa 4963 HH bb 4480
2673 HH bb 4713 HH bb 4760 HH bb 5088 HH bb 5113 HH bb 5310 II aa 2988
2674 II aa 3242 II bb 2835 II bb 2969 II bb 3197 II bb 3219 II bb 3390
2675 JJ aa 2901 JJ aa 3032 JJ aa 3566 JJ aa 3687 JJ bb 2961 JJ bb 3446
2676 JJ bb 3464 JJ bb 3543}
2678 do_execsql_test 1.16.7 {
2679 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2680 } {AA aa 1373 AA aa 1396 AA aa 2068 AA aa 2084 AA bb 1508 AA bb 1751
2681 AA bb 1806 AA bb 2069 BB aa 2111 BB aa 2213 BB aa 2461 BB aa 2474
2682 BB aa 2480 BB aa 2626 BB bb 3627 BB bb 3675 BB bb 3681 BB bb 3756
2683 BB bb 3762 BB bb 3834 CC aa 1195 CC aa 1347 CC aa 1524 CC aa 1796
2684 CC bb 346 CC bb 822 DD aa 480 DD aa 1069 DD aa 1101 DD bb 1748
2685 DD bb 1913 DD bb 1991 DD bb 2469 EE aa 113 EE aa 777 EE bb 881
2686 EE bb 1020 EE bb 1397 FF aa 1493 FF aa 1496 FF aa 1545 FF aa 1955
2687 FF bb 2567 FF bb 2635 FF bb 2779 FF bb 2931 FF bb 3210 FF bb 3403
2688 GG aa 963 GG aa 1117 GG aa 1262 GG aa 1449 GG bb 1933 GG bb 1942
2689 GG bb 2027 GG bb 2711 HH aa 1270 HH aa 1459 HH aa 1769 HH bb 2231
2690 HH bb 2464 HH bb 2511 HH bb 2839 HH bb 2864 HH bb 3061 II aa 398
2691 II aa 652 II bb 1785 II bb 1919 II bb 2147 II bb 2169 II bb 2340
2692 JJ aa 1115 JJ aa 1246 JJ aa 1780 JJ aa 1901 JJ bb 947 JJ bb 1432
2693 JJ bb 1450 JJ bb 1529}
2695 do_execsql_test 1.16.8 {
2697 sum(c) OVER (ORDER BY a GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW),
2698 sum(c) OVER (ORDER BY a GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING ),
2699 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW),
2700 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 0 FOLLOWING AND 0 FOLLOWING )
2701 FROM t3 ORDER BY 1, 2, 3;
2702 } {AA aa 3751 4685 1373 2307 AA aa 3774 4685 1396 2307
2703 AA aa 4446 4685 2068 2307 AA aa 4462 4685 2084 2307
2704 AA bb 3815 4685 1508 2378 AA bb 4058 4685 1751 2378
2705 AA bb 4113 4685 1806 2378 AA bb 4376 4685 2069 2378
2706 BB aa 6578 7340 2111 2873 BB aa 6680 7340 2213 2873
2707 BB aa 6928 7340 2461 2873 BB aa 6941 7340 2474 2873
2708 BB aa 6947 7340 2480 2873 BB aa 7093 7340 2626 2873
2709 BB bb 6500 7340 3627 4467 BB bb 6548 7340 3675 4467
2710 BB bb 6554 7340 3681 4467 BB bb 6629 7340 3756 4467
2711 BB bb 6635 7340 3762 4467 BB bb 6707 7340 3834 4467
2712 CC aa 2363 3122 1195 1954 CC aa 2515 3122 1347 1954
2713 CC aa 2692 3122 1524 1954 CC aa 2964 3122 1796 1954
2714 CC bb 2300 3122 346 1168 CC bb 2776 3122 822 1168
2715 DD aa 3187 4032 480 1325 DD aa 3776 4032 1069 1325
2716 DD aa 3808 4032 1101 1325 DD bb 3073 4032 1748 2707
2717 DD bb 3238 4032 1913 2707 DD bb 3316 4032 1991 2707
2718 DD bb 3794 4032 2469 2707 EE aa 1762 2539 113 890
2719 EE aa 2426 2539 777 890 EE bb 1771 2539 881 1649
2720 EE bb 1910 2539 1020 1649 EE bb 2287 2539 1397 1649
2721 FF aa 4998 5668 1493 2163 FF aa 5001 5668 1496 2163
2722 FF aa 5050 5668 1545 2163 FF aa 5460 5668 1955 2163
2723 FF bb 4730 5668 2567 3505 FF bb 4798 5668 2635 3505
2724 FF bb 4942 5668 2779 3505 FF bb 5094 5668 2931 3505
2725 FF bb 5373 5668 3210 3505 FF bb 5566 5668 3403 3505
2726 GG aa 3834 4468 963 1597 GG aa 3988 4468 1117 1597
2727 GG aa 4133 4468 1262 1597 GG aa 4320 4468 1449 1597
2728 GG bb 3530 4468 1933 2871 GG bb 3539 4468 1942 2871
2729 GG bb 3624 4468 2027 2871 GG bb 4308 4468 2711 2871
2730 HH aa 4464 5443 1270 2249 HH aa 4653 5443 1459 2249
2731 HH aa 4963 5443 1769 2249 HH bb 4480 5443 2231 3194
2732 HH bb 4713 5443 2464 3194 HH bb 4760 5443 2511 3194
2733 HH bb 5088 5443 2839 3194 HH bb 5113 5443 2864 3194
2734 HH bb 5310 5443 3061 3194 II aa 2988 3640 398 1050
2735 II aa 3242 3640 652 1050 II bb 2835 3640 1785 2590
2736 II bb 2969 3640 1919 2590 II bb 3197 3640 2147 2590
2737 II bb 3219 3640 2169 2590 II bb 3390 3640 2340 2590
2738 JJ aa 2901 3800 1115 2014 JJ aa 3032 3800 1246 2014
2739 JJ aa 3566 3800 1780 2014 JJ aa 3687 3800 1901 2014
2740 JJ bb 2961 3800 947 1786 JJ bb 3446 3800 1432 1786
2741 JJ bb 3464 3800 1450 1786 JJ bb 3543 3800 1529 1786}
2743 do_execsql_test 1.17.1 {
2744 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2745 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
2746 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
2747 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
2748 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
2749 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
2750 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
2751 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
2752 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
2753 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
2754 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
2755 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
2756 JJ bb {} JJ bb {} JJ bb {}}
2758 do_execsql_test 1.17.2 {
2759 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2760 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
2761 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
2762 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
2763 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
2764 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
2765 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
2766 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
2767 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
2768 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
2769 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
2770 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
2771 JJ bb {} JJ bb {} JJ bb {}}
2773 do_execsql_test 1.17.3 {
2774 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2775 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
2776 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
2777 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
2778 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
2779 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
2780 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
2781 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
2782 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
2783 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
2784 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
2785 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
2786 JJ bb 73 JJ bb 73 JJ bb 73}
2788 do_execsql_test 1.17.4 {
2789 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2790 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
2791 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
2792 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
2793 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
2794 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
2795 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
2796 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
2797 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
2798 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
2799 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
2800 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
2801 JJ bb {} JJ bb {} JJ bb {}}
2803 do_execsql_test 1.17.5 {
2804 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2805 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
2806 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
2807 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
2808 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
2809 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
2810 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
2811 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
2812 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
2813 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
2814 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
2815 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
2816 JJ bb {} JJ bb {} JJ bb {}}
2818 do_execsql_test 1.17.6 {
2819 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2820 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
2821 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
2822 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
2823 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
2824 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
2825 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
2826 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
2827 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
2828 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
2829 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
2830 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
2831 JJ bb {} JJ bb {} JJ bb {}}
2833 do_execsql_test 1.17.7 {
2834 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2835 } {AA aa {} AA aa {} AA aa {} AA aa {} AA bb {} AA bb {} AA bb {}
2836 AA bb {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {} BB aa {}
2837 BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} BB bb {} CC aa {}
2838 CC aa {} CC aa {} CC aa {} CC bb {} CC bb {} DD aa {} DD aa {}
2839 DD aa {} DD bb {} DD bb {} DD bb {} DD bb {} EE aa {} EE aa {}
2840 EE bb {} EE bb {} EE bb {} FF aa {} FF aa {} FF aa {} FF aa {}
2841 FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} FF bb {} GG aa {}
2842 GG aa {} GG aa {} GG aa {} GG bb {} GG bb {} GG bb {} GG bb {}
2843 HH aa {} HH aa {} HH aa {} HH bb {} HH bb {} HH bb {} HH bb {}
2844 HH bb {} HH bb {} II aa {} II aa {} II bb {} II bb {} II bb {}
2845 II bb {} II bb {} JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {}
2846 JJ bb {} JJ bb {} JJ bb {}}
2848 do_execsql_test 1.17.8 {
2850 sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW),
2851 sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING ),
2852 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING EXCLUDE CURRENT ROW),
2853 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 0 FOLLOWING )
2854 FROM t3 ORDER BY 1, 2, 3;
2855 } {AA aa {} {} {} {} AA aa {} {} {} {} AA aa {} {} {} {}
2856 AA aa {} {} {} {} AA bb {} {} {} {} AA bb {} {} {} {}
2857 AA bb {} {} {} {} AA bb {} {} {} {} BB aa {} {} {} {}
2858 BB aa {} {} {} {} BB aa {} {} {} {} BB aa {} {} {} {}
2859 BB aa {} {} {} {} BB aa {} {} {} {} BB bb {} {} {} {}
2860 BB bb {} {} {} {} BB bb {} {} {} {} BB bb {} {} {} {}
2861 BB bb {} {} {} {} BB bb {} {} {} {} CC aa {} {} {} {}
2862 CC aa {} {} {} {} CC aa {} {} {} {} CC aa {} {} {} {}
2863 CC bb {} {} {} {} CC bb {} {} {} {} DD aa {} {} {} {}
2864 DD aa {} {} {} {} DD aa {} {} {} {} DD bb {} {} {} {}
2865 DD bb {} {} {} {} DD bb {} {} {} {} DD bb {} {} {} {}
2866 EE aa {} {} {} {} EE aa {} {} {} {} EE bb {} {} {} {}
2867 EE bb {} {} {} {} EE bb {} {} {} {} FF aa {} {} {} {}
2868 FF aa {} {} {} {} FF aa {} {} {} {} FF aa {} {} {} {}
2869 FF bb {} {} {} {} FF bb {} {} {} {} FF bb {} {} {} {}
2870 FF bb {} {} {} {} FF bb {} {} {} {} FF bb {} {} {} {}
2871 GG aa {} {} {} {} GG aa {} {} {} {} GG aa {} {} {} {}
2872 GG aa {} {} {} {} GG bb {} {} {} {} GG bb {} {} {} {}
2873 GG bb {} {} {} {} GG bb {} {} {} {} HH aa {} {} {} {}
2874 HH aa {} {} {} {} HH aa {} {} {} {} HH bb {} {} {} {}
2875 HH bb {} {} {} {} HH bb {} {} {} {} HH bb {} {} {} {}
2876 HH bb {} {} {} {} HH bb {} {} {} {} II aa {} {} {} {}
2877 II aa {} {} {} {} II bb {} {} {} {} II bb {} {} {} {}
2878 II bb {} {} {} {} II bb {} {} {} {} II bb {} {} {} {}
2879 JJ aa {} {} {} {} JJ aa {} {} {} {} JJ aa {} {} {} {}
2880 JJ aa {} {} {} {} JJ bb {} {} {} {} JJ bb {} {} {} {}
2881 JJ bb {} {} {} {} JJ bb {} {} {} {}}
2883 do_execsql_test 1.18.1 {
2884 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2885 } {AA aa 22701 AA aa 22701 AA aa 22701 AA aa 22701 AA bb 22701
2886 AA bb 22701 AA bb 22701 AA bb 22701 BB aa 19829 BB aa 19829
2887 BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB bb 19829
2888 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829
2889 CC aa 22150 CC aa 22150 CC aa 22150 CC aa 22150 CC bb 22150
2890 CC bb 22150 DD aa 21758 DD aa 21758 DD aa 21758 DD bb 21758
2891 DD bb 21758 DD bb 21758 DD bb 21758 EE aa 23019 EE aa 23019
2892 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351
2893 FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351
2894 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883
2895 GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883
2896 GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440
2897 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800
2898 II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800
2899 JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {}
2902 do_execsql_test 1.18.2 {
2903 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2904 } {AA aa 12840 AA aa 12840 AA aa 12840 AA aa 12840 AA bb 11787
2905 AA bb 11787 AA bb 11787 AA bb 11787 BB aa 11621 BB aa 11621
2906 BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB bb 8044
2907 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 CC aa 7739
2908 CC aa 7739 CC aa 7739 CC aa 7739 CC bb 8734 CC bb 8734
2909 DD aa 10914 DD aa 10914 DD aa 10914 DD bb 9804 DD bb 9804
2910 DD bb 9804 DD bb 9804 EE aa 11785 EE aa 11785 EE bb 12385
2911 EE bb 12385 EE bb 12385 FF aa 13416 FF aa 13416 FF aa 13416
2912 FF aa 13416 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961
2913 FF bb 10961 FF bb 10961 GG aa 11954 GG aa 11954 GG aa 11954
2914 GG aa 11954 GG bb 11097 GG bb 11097 GG bb 11097 GG bb 11097
2915 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 HH bb 7440
2916 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 II aa 6390
2917 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa 1786
2918 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} JJ bb {}
2921 do_execsql_test 1.18.3 {
2922 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2923 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
2924 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
2925 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
2926 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
2927 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
2928 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
2929 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
2930 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
2931 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
2932 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
2933 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
2934 JJ bb 73 JJ bb 73 JJ bb 73}
2936 do_execsql_test 1.18.4 {
2937 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2938 } {AA aa 870 AA aa 870 AA aa 870 AA aa 870 AA bb 845 AA bb 845
2939 AA bb 845 AA bb 845 BB aa 959 BB aa 959 BB aa 959 BB aa 959
2940 BB aa 959 BB aa 959 BB bb 959 BB bb 959 BB bb 959 BB bb 959
2941 BB bb 959 BB bb 959 CC aa 959 CC aa 959 CC aa 959 CC aa 959
2942 CC bb 959 CC bb 959 DD aa 959 DD aa 959 DD aa 959 DD bb 938
2943 DD bb 938 DD bb 938 DD bb 938 EE aa 938 EE aa 938 EE bb 979
2944 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979
2945 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979
2946 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979
2947 GG bb 979 GG bb 979 HH aa 963 HH aa 963 HH aa 963 HH bb 899
2948 HH bb 899 HH bb 899 HH bb 899 HH bb 899 HH bb 899 II aa 899
2949 II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899
2950 JJ aa 839 JJ aa 839 JJ aa 839 JJ aa 839 JJ bb {} JJ bb {}
2953 do_execsql_test 1.18.5 {
2954 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
2955 } {AA aa 158 AA aa 158 AA aa 158 AA aa 158 AA bb 158 AA bb 158
2956 AA bb 158 AA bb 158 BB aa 158 BB aa 158 BB aa 158 BB aa 158
2957 BB aa 158 BB aa 158 BB bb 113 BB bb 113 BB bb 113 BB bb 113
2958 BB bb 113 BB bb 113 CC aa 113 CC aa 113 CC aa 113 CC aa 113
2959 CC bb 113 CC bb 113 DD aa 102 DD aa 102 DD aa 102 DD bb 102
2960 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102
2961 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102
2962 FF bb 133 FF bb 133 FF bb 133 FF bb 133 FF bb 133 FF bb 133
2963 GG aa 133 GG aa 133 GG aa 133 GG aa 133 GG bb 113 GG bb 113
2964 GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113
2965 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113
2966 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113
2967 JJ aa 257 JJ aa 257 JJ aa 257 JJ aa 257 JJ bb {} JJ bb {}
2970 do_execsql_test 1.18.6 {
2971 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2972 } {AA aa 22701 AA aa 22701 AA aa 22701 AA aa 22701 AA bb 22701
2973 AA bb 22701 AA bb 22701 AA bb 22701 BB aa 19829 BB aa 19829
2974 BB aa 19829 BB aa 19829 BB aa 19829 BB aa 19829 BB bb 19829
2975 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829 BB bb 19829
2976 CC aa 22150 CC aa 22150 CC aa 22150 CC aa 22150 CC bb 22150
2977 CC bb 22150 DD aa 21758 DD aa 21758 DD aa 21758 DD bb 21758
2978 DD bb 21758 DD bb 21758 DD bb 21758 EE aa 23019 EE aa 23019
2979 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351
2980 FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351
2981 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883
2982 GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883
2983 GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440
2984 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800
2985 II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800
2986 JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {}
2989 do_execsql_test 1.18.7 {
2990 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
2991 } {AA aa 12840 AA aa 12840 AA aa 12840 AA aa 12840 AA bb 11787
2992 AA bb 11787 AA bb 11787 AA bb 11787 BB aa 11621 BB aa 11621
2993 BB aa 11621 BB aa 11621 BB aa 11621 BB aa 11621 BB bb 8044
2994 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 BB bb 8044 CC aa 7739
2995 CC aa 7739 CC aa 7739 CC aa 7739 CC bb 8734 CC bb 8734
2996 DD aa 10914 DD aa 10914 DD aa 10914 DD bb 9804 DD bb 9804
2997 DD bb 9804 DD bb 9804 EE aa 11785 EE aa 11785 EE bb 12385
2998 EE bb 12385 EE bb 12385 FF aa 13416 FF aa 13416 FF aa 13416
2999 FF aa 13416 FF bb 10961 FF bb 10961 FF bb 10961 FF bb 10961
3000 FF bb 10961 FF bb 10961 GG aa 11954 GG aa 11954 GG aa 11954
3001 GG aa 11954 GG bb 11097 GG bb 11097 GG bb 11097 GG bb 11097
3002 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440 HH bb 7440
3003 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390 II aa 6390
3004 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 JJ aa 1786
3005 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {} JJ bb {}
3008 do_execsql_test 1.18.8 {
3010 sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING EXCLUDE CURRENT ROW),
3011 sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING ),
3012 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING EXCLUDE CURRENT ROW),
3013 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND 5 FOLLOWING )
3014 FROM t3 ORDER BY 1, 2, 3;
3015 } {AA aa 22701 22701 12840 12840 AA aa 22701 22701 12840 12840
3016 AA aa 22701 22701 12840 12840 AA aa 22701 22701 12840 12840
3017 AA bb 22701 22701 11787 11787 AA bb 22701 22701 11787 11787
3018 AA bb 22701 22701 11787 11787 AA bb 22701 22701 11787 11787
3019 BB aa 19829 19829 11621 11621 BB aa 19829 19829 11621 11621
3020 BB aa 19829 19829 11621 11621 BB aa 19829 19829 11621 11621
3021 BB aa 19829 19829 11621 11621 BB aa 19829 19829 11621 11621
3022 BB bb 19829 19829 8044 8044 BB bb 19829 19829 8044 8044
3023 BB bb 19829 19829 8044 8044 BB bb 19829 19829 8044 8044
3024 BB bb 19829 19829 8044 8044 BB bb 19829 19829 8044 8044
3025 CC aa 22150 22150 7739 7739 CC aa 22150 22150 7739 7739
3026 CC aa 22150 22150 7739 7739 CC aa 22150 22150 7739 7739
3027 CC bb 22150 22150 8734 8734 CC bb 22150 22150 8734 8734
3028 DD aa 21758 21758 10914 10914 DD aa 21758 21758 10914 10914
3029 DD aa 21758 21758 10914 10914 DD bb 21758 21758 9804 9804
3030 DD bb 21758 21758 9804 9804 DD bb 21758 21758 9804 9804
3031 DD bb 21758 21758 9804 9804 EE aa 23019 23019 11785 11785
3032 EE aa 23019 23019 11785 11785 EE bb 23019 23019 12385 12385
3033 EE bb 23019 23019 12385 12385 EE bb 23019 23019 12385 12385
3034 FF aa 17351 17351 13416 13416 FF aa 17351 17351 13416 13416
3035 FF aa 17351 17351 13416 13416 FF aa 17351 17351 13416 13416
3036 FF bb 17351 17351 10961 10961 FF bb 17351 17351 10961 10961
3037 FF bb 17351 17351 10961 10961 FF bb 17351 17351 10961 10961
3038 FF bb 17351 17351 10961 10961 FF bb 17351 17351 10961 10961
3039 GG aa 12883 12883 11954 11954 GG aa 12883 12883 11954 11954
3040 GG aa 12883 12883 11954 11954 GG aa 12883 12883 11954 11954
3041 GG bb 12883 12883 11097 11097 GG bb 12883 12883 11097 11097
3042 GG bb 12883 12883 11097 11097 GG bb 12883 12883 11097 11097
3043 HH aa 7440 7440 10634 10634 HH aa 7440 7440 10634 10634
3044 HH aa 7440 7440 10634 10634 HH bb 7440 7440 7440 7440
3045 HH bb 7440 7440 7440 7440 HH bb 7440 7440 7440 7440
3046 HH bb 7440 7440 7440 7440 HH bb 7440 7440 7440 7440
3047 HH bb 7440 7440 7440 7440 II aa 3800 3800 6390 6390
3048 II aa 3800 3800 6390 6390 II bb 3800 3800 3800 3800
3049 II bb 3800 3800 3800 3800 II bb 3800 3800 3800 3800
3050 II bb 3800 3800 3800 3800 II bb 3800 3800 3800 3800
3051 JJ aa {} {} 1786 1786 JJ aa {} {} 1786 1786 JJ aa {} {} 1786 1786
3052 JJ aa {} {} 1786 1786 JJ bb {} {} {} {} JJ bb {} {} {} {}
3053 JJ bb {} {} {} {} JJ bb {} {} {} {}}
3055 do_execsql_test 1.19.1 {
3056 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
3057 } {AA aa 40052 AA aa 40052 AA aa 40052 AA aa 40052 AA bb 40052
3058 AA bb 40052 AA bb 40052 AA bb 40052 BB aa 32712 BB aa 32712
3059 BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB bb 32712
3060 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712
3061 CC aa 29590 CC aa 29590 CC aa 29590 CC aa 29590 CC bb 29590
3062 CC bb 29590 DD aa 25558 DD aa 25558 DD aa 25558 DD bb 25558
3063 DD bb 25558 DD bb 25558 DD bb 25558 EE aa 23019 EE aa 23019
3064 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351
3065 FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351
3066 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883
3067 GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883
3068 GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440
3069 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800
3070 II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800
3071 JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {}
3074 do_execsql_test 1.19.2 {
3075 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
3076 } {AA aa 42430 AA aa 42430 AA aa 42430 AA aa 42430 AA bb 40052
3077 AA bb 40052 AA bb 40052 AA bb 40052 BB aa 37179 BB aa 37179
3078 BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB bb 32712
3079 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712
3080 CC aa 30758 CC aa 30758 CC aa 30758 CC aa 30758 CC bb 29590
3081 CC bb 29590 DD aa 28265 DD aa 28265 DD aa 28265 DD bb 25558
3082 DD bb 25558 DD bb 25558 DD bb 25558 EE aa 24668 EE aa 24668
3083 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 20856 FF aa 20856
3084 FF aa 20856 FF aa 20856 FF bb 17351 FF bb 17351 FF bb 17351
3085 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 15754 GG aa 15754
3086 GG aa 15754 GG aa 15754 GG bb 12883 GG bb 12883 GG bb 12883
3087 GG bb 12883 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440
3088 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390
3089 II aa 6390 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800
3090 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {}
3093 do_execsql_test 1.19.3 {
3094 SELECT a, b, rank() OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
3095 } {AA aa 1 AA aa 1 AA aa 1 AA aa 1 AA bb 1 AA bb 1 AA bb 1
3096 AA bb 1 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9 BB aa 9
3097 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 BB bb 9 CC aa 21
3098 CC aa 21 CC aa 21 CC aa 21 CC bb 21 CC bb 21 DD aa 27 DD aa 27
3099 DD aa 27 DD bb 27 DD bb 27 DD bb 27 DD bb 27 EE aa 34 EE aa 34
3100 EE bb 34 EE bb 34 EE bb 34 FF aa 39 FF aa 39 FF aa 39 FF aa 39
3101 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 FF bb 39 GG aa 49
3102 GG aa 49 GG aa 49 GG aa 49 GG bb 49 GG bb 49 GG bb 49 GG bb 49
3103 HH aa 57 HH aa 57 HH aa 57 HH bb 57 HH bb 57 HH bb 57 HH bb 57
3104 HH bb 57 HH bb 57 II aa 66 II aa 66 II bb 66 II bb 66 II bb 66
3105 II bb 66 II bb 66 JJ aa 73 JJ aa 73 JJ aa 73 JJ aa 73 JJ bb 73
3106 JJ bb 73 JJ bb 73 JJ bb 73}
3108 do_execsql_test 1.19.4 {
3109 SELECT a, b, max(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
3110 } {AA aa 979 AA aa 979 AA aa 979 AA aa 979 AA bb 979 AA bb 979
3111 AA bb 979 AA bb 979 BB aa 979 BB aa 979 BB aa 979 BB aa 979
3112 BB aa 979 BB aa 979 BB bb 979 BB bb 979 BB bb 979 BB bb 979
3113 BB bb 979 BB bb 979 CC aa 979 CC aa 979 CC aa 979 CC aa 979
3114 CC bb 979 CC bb 979 DD aa 979 DD aa 979 DD aa 979 DD bb 979
3115 DD bb 979 DD bb 979 DD bb 979 EE aa 979 EE aa 979 EE bb 979
3116 EE bb 979 EE bb 979 FF aa 979 FF aa 979 FF aa 979 FF aa 979
3117 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979 FF bb 979
3118 GG aa 979 GG aa 979 GG aa 979 GG aa 979 GG bb 979 GG bb 979
3119 GG bb 979 GG bb 979 HH aa 963 HH aa 963 HH aa 963 HH bb 899
3120 HH bb 899 HH bb 899 HH bb 899 HH bb 899 HH bb 899 II aa 899
3121 II aa 899 II bb 899 II bb 899 II bb 899 II bb 899 II bb 899
3122 JJ aa 839 JJ aa 839 JJ aa 839 JJ aa 839 JJ bb {} JJ bb {}
3125 do_execsql_test 1.19.5 {
3126 SELECT a, b, min(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t3 ORDER BY 1, 2, 3;
3127 } {AA aa 102 AA aa 102 AA aa 102 AA aa 102 AA bb 102 AA bb 102
3128 AA bb 102 AA bb 102 BB aa 102 BB aa 102 BB aa 102 BB aa 102
3129 BB aa 102 BB aa 102 BB bb 102 BB bb 102 BB bb 102 BB bb 102
3130 BB bb 102 BB bb 102 CC aa 102 CC aa 102 CC aa 102 CC aa 102
3131 CC bb 102 CC bb 102 DD aa 102 DD aa 102 DD aa 102 DD bb 102
3132 DD bb 102 DD bb 102 DD bb 102 EE aa 102 EE aa 102 EE bb 102
3133 EE bb 102 EE bb 102 FF aa 102 FF aa 102 FF aa 102 FF aa 102
3134 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113 FF bb 113
3135 GG aa 113 GG aa 113 GG aa 113 GG aa 113 GG bb 113 GG bb 113
3136 GG bb 113 GG bb 113 HH aa 113 HH aa 113 HH aa 113 HH bb 113
3137 HH bb 113 HH bb 113 HH bb 113 HH bb 113 HH bb 113 II aa 113
3138 II aa 113 II bb 113 II bb 113 II bb 113 II bb 113 II bb 113
3139 JJ aa 257 JJ aa 257 JJ aa 257 JJ aa 257 JJ bb {} JJ bb {}
3142 do_execsql_test 1.19.6 {
3143 SELECT a, b, sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
3144 } {AA aa 40052 AA aa 40052 AA aa 40052 AA aa 40052 AA bb 40052
3145 AA bb 40052 AA bb 40052 AA bb 40052 BB aa 32712 BB aa 32712
3146 BB aa 32712 BB aa 32712 BB aa 32712 BB aa 32712 BB bb 32712
3147 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712
3148 CC aa 29590 CC aa 29590 CC aa 29590 CC aa 29590 CC bb 29590
3149 CC bb 29590 DD aa 25558 DD aa 25558 DD aa 25558 DD bb 25558
3150 DD bb 25558 DD bb 25558 DD bb 25558 EE aa 23019 EE aa 23019
3151 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 17351 FF aa 17351
3152 FF aa 17351 FF aa 17351 FF bb 17351 FF bb 17351 FF bb 17351
3153 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 12883 GG aa 12883
3154 GG aa 12883 GG aa 12883 GG bb 12883 GG bb 12883 GG bb 12883
3155 GG bb 12883 HH aa 7440 HH aa 7440 HH aa 7440 HH bb 7440
3156 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 3800
3157 II aa 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800
3158 JJ aa {} JJ aa {} JJ aa {} JJ aa {} JJ bb {} JJ bb {} JJ bb {}
3161 do_execsql_test 1.19.7 {
3162 SELECT a, b, sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW) FROM t3 ORDER BY 1, 2, 3;
3163 } {AA aa 42430 AA aa 42430 AA aa 42430 AA aa 42430 AA bb 40052
3164 AA bb 40052 AA bb 40052 AA bb 40052 BB aa 37179 BB aa 37179
3165 BB aa 37179 BB aa 37179 BB aa 37179 BB aa 37179 BB bb 32712
3166 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712 BB bb 32712
3167 CC aa 30758 CC aa 30758 CC aa 30758 CC aa 30758 CC bb 29590
3168 CC bb 29590 DD aa 28265 DD aa 28265 DD aa 28265 DD bb 25558
3169 DD bb 25558 DD bb 25558 DD bb 25558 EE aa 24668 EE aa 24668
3170 EE bb 23019 EE bb 23019 EE bb 23019 FF aa 20856 FF aa 20856
3171 FF aa 20856 FF aa 20856 FF bb 17351 FF bb 17351 FF bb 17351
3172 FF bb 17351 FF bb 17351 FF bb 17351 GG aa 15754 GG aa 15754
3173 GG aa 15754 GG aa 15754 GG bb 12883 GG bb 12883 GG bb 12883
3174 GG bb 12883 HH aa 10634 HH aa 10634 HH aa 10634 HH bb 7440
3175 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 HH bb 7440 II aa 6390
3176 II aa 6390 II bb 3800 II bb 3800 II bb 3800 II bb 3800 II bb 3800
3177 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ aa 1786 JJ bb {} JJ bb {}
3180 do_execsql_test 1.19.8 {
3182 sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW),
3183 sum(c) OVER (ORDER BY a GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING ),
3184 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW),
3185 sum(c) OVER (ORDER BY a,b GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING )
3186 FROM t3 ORDER BY 1, 2, 3;
3187 } {AA aa 40052 40052 42430 42430 AA aa 40052 40052 42430 42430
3188 AA aa 40052 40052 42430 42430 AA aa 40052 40052 42430 42430
3189 AA bb 40052 40052 40052 40052 AA bb 40052 40052 40052 40052
3190 AA bb 40052 40052 40052 40052 AA bb 40052 40052 40052 40052
3191 BB aa 32712 32712 37179 37179 BB aa 32712 32712 37179 37179
3192 BB aa 32712 32712 37179 37179 BB aa 32712 32712 37179 37179
3193 BB aa 32712 32712 37179 37179 BB aa 32712 32712 37179 37179
3194 BB bb 32712 32712 32712 32712 BB bb 32712 32712 32712 32712
3195 BB bb 32712 32712 32712 32712 BB bb 32712 32712 32712 32712
3196 BB bb 32712 32712 32712 32712 BB bb 32712 32712 32712 32712
3197 CC aa 29590 29590 30758 30758 CC aa 29590 29590 30758 30758
3198 CC aa 29590 29590 30758 30758 CC aa 29590 29590 30758 30758
3199 CC bb 29590 29590 29590 29590 CC bb 29590 29590 29590 29590
3200 DD aa 25558 25558 28265 28265 DD aa 25558 25558 28265 28265
3201 DD aa 25558 25558 28265 28265 DD bb 25558 25558 25558 25558
3202 DD bb 25558 25558 25558 25558 DD bb 25558 25558 25558 25558
3203 DD bb 25558 25558 25558 25558 EE aa 23019 23019 24668 24668
3204 EE aa 23019 23019 24668 24668 EE bb 23019 23019 23019 23019
3205 EE bb 23019 23019 23019 23019 EE bb 23019 23019 23019 23019
3206 FF aa 17351 17351 20856 20856 FF aa 17351 17351 20856 20856
3207 FF aa 17351 17351 20856 20856 FF aa 17351 17351 20856 20856
3208 FF bb 17351 17351 17351 17351 FF bb 17351 17351 17351 17351
3209 FF bb 17351 17351 17351 17351 FF bb 17351 17351 17351 17351
3210 FF bb 17351 17351 17351 17351 FF bb 17351 17351 17351 17351
3211 GG aa 12883 12883 15754 15754 GG aa 12883 12883 15754 15754
3212 GG aa 12883 12883 15754 15754 GG aa 12883 12883 15754 15754
3213 GG bb 12883 12883 12883 12883 GG bb 12883 12883 12883 12883
3214 GG bb 12883 12883 12883 12883 GG bb 12883 12883 12883 12883
3215 HH aa 7440 7440 10634 10634 HH aa 7440 7440 10634 10634
3216 HH aa 7440 7440 10634 10634 HH bb 7440 7440 7440 7440
3217 HH bb 7440 7440 7440 7440 HH bb 7440 7440 7440 7440
3218 HH bb 7440 7440 7440 7440 HH bb 7440 7440 7440 7440
3219 HH bb 7440 7440 7440 7440 II aa 3800 3800 6390 6390
3220 II aa 3800 3800 6390 6390 II bb 3800 3800 3800 3800
3221 II bb 3800 3800 3800 3800 II bb 3800 3800 3800 3800
3222 II bb 3800 3800 3800 3800 II bb 3800 3800 3800 3800
3223 JJ aa {} {} 1786 1786 JJ aa {} {} 1786 1786 JJ aa {} {} 1786 1786
3224 JJ aa {} {} 1786 1786 JJ bb {} {} {} {} JJ bb {} {} {} {}
3225 JJ bb {} {} {} {} JJ bb {} {} {} {}}
3227 do_execsql_test 2.1.1 {
3228 SELECT row_number() OVER win
3232 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS
3234 } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
3235 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
3236 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
3237 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
3238 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
3241 do_execsql_test 2.1.2 {
3242 SELECT nth_value(c, 14) OVER win
3246 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS
3248 } {247 247 247 247 247 247 247 247 247 247 247 247 247
3249 247 247 247 247 247 247 247 247 247 247 247 247 247
3250 247 247 247 247 247 247 247 247 247 247 247 247 247
3251 247 247 247 247 247 247 247 247 247 247 247 247 247
3252 247 247 247 247 247 247 247 247 247 247 247 247 247
3253 247 247 247 247 247 247 247 247 247 247 247 247 247
3256 do_execsql_test 2.1.3 {
3257 SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
3260 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE NO OTHERS
3262 } {102 223 1358 102 239 2293 102 911 38097 102 934 39960 102 309 4159
3263 102 572 10643 102 627 13069 102 870 35417 102 247 2540 102 393 6608
3264 102 399 7405 102 412 7817 102 660 16277 102 762 24077 102 633 14331
3265 102 705 19673 102 711 20384 102 786 27176 102 792 28758
3266 102 840 32858 102 158 767 102 430 8668 102 607 11824 102 759 23315
3267 102 346 5506 102 822 31179 102 224 1582 102 256 3298 102 845 34547
3268 102 238 2054 102 716 21100 102 794 29552 102 959 42795 102 113 215
3269 102 777 26390 102 252 3042 102 629 13698 102 768 25613 102 208 1135
3270 102 618 12442 102 667 16944 102 670 17614 102 102 102 102 295 3850
3271 102 574 11217 102 726 21826 102 870 36287 102 938 40898 102 148 609
3272 102 335 4824 102 480 9591 102 634 14965 102 160 927 102 844 33702
3273 102 929 39026 102 938 41836 102 480 10071 102 790 27966
3274 102 979 44737 102 133 461 102 330 4489 102 355 6215 102 683 18968
3275 102 730 22556 102 963 43758 102 398 7006 102 652 15617 102 250 2790
3276 102 421 8238 102 443 9111 102 671 18285 102 805 30357 102 113 328
3277 102 234 1816 102 768 24845 102 899 37186 102 257 3555 102 336 5160
3278 102 354 5860 102 839 32018}
3280 do_execsql_test 2.2.1 {
3281 SELECT row_number() OVER win
3285 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW
3287 } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
3288 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
3289 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
3290 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
3291 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
3294 do_execsql_test 2.2.2 {
3295 SELECT nth_value(c, 14) OVER win
3299 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW
3301 } {250 250 250 250 250 250 250 250 250 250 250 250 250
3302 250 247 247 247 247 247 247 247 247 247 247 247 247
3303 247 247 247 247 247 247 247 247 247 247 247 247 247
3304 247 247 247 247 247 247 247 247 247 247 247 247 247
3305 247 247 247 247 247 247 247 247 247 247 247 247 247
3306 247 247 247 247 247 247 247 247 247 247 247 247 247
3309 do_execsql_test 2.2.3 {
3310 SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
3313 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE CURRENT ROW
3315 } {102 208 1135 102 238 2054 102 899 37186 102 929 39026 102 295 3850
3316 102 480 10071 102 618 12442 102 845 34547 102 239 2293 102 355 6215
3317 102 398 7006 102 399 7405 102 652 15617 102 759 23315 102 629 13698
3318 102 683 18968 102 705 19673 102 777 26390 102 790 27966
3319 102 839 32018 102 148 609 102 421 8238 102 574 11217 102 730 22556
3320 102 336 5160 102 805 30357 102 223 1358 102 252 3042 102 844 33702
3321 102 234 1816 102 711 20384 102 792 28758 102 938 41836 102 102 102
3322 102 768 25613 102 250 2790 102 627 13069 102 768 24845 102 160 927
3323 102 607 11824 102 660 16277 102 667 16944 {} {} {} 102 257 3555
3324 102 572 10643 102 716 21100 102 870 35417 102 934 39960 102 133 461
3325 102 330 4489 102 443 9111 102 633 14331 102 158 767 102 840 32858
3326 102 911 38097 102 938 40898 102 480 9591 102 786 27176
3327 102 963 43758 102 113 328 102 309 4159 102 354 5860 102 671 18285
3328 102 726 21826 102 959 42795 102 393 6608 102 634 14965 102 247 2540
3329 102 412 7817 102 430 8668 102 670 17614 102 794 29552 102 113 215
3330 102 224 1582 102 762 24077 102 870 36287 102 256 3298 102 335 4824
3331 102 346 5506 102 822 31179}
3333 do_execsql_test 2.3.1 {
3334 SELECT row_number() OVER win
3338 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP
3340 } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
3341 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
3342 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
3343 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
3344 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
3347 do_execsql_test 2.3.2 {
3348 SELECT nth_value(c, 14) OVER win
3352 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP
3354 } {250 250 250 250 250 250 250 250 250 250 250 250 250
3355 250 247 247 247 247 247 247 247 247 247 247 247 247
3356 247 247 247 247 247 247 247 247 247 247 247 247 247
3357 247 247 247 247 247 247 247 247 247 247 247 247 247
3358 247 247 247 247 247 247 247 247 247 247 247 247 247
3359 247 247 247 247 247 247 247 247 247 247 247 247 247
3362 do_execsql_test 2.3.3 {
3363 SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
3366 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE GROUP
3368 } {102 208 1135 102 238 2054 102 899 37186 102 929 39026 102 295 3850
3369 102 480 10071 102 618 12442 102 845 34547 102 239 2293 102 355 6215
3370 102 398 7006 102 399 7405 102 652 15617 102 759 23315 102 629 13698
3371 102 683 18968 102 705 19673 102 777 26390 102 790 27966
3372 102 839 32018 102 148 609 102 421 8238 102 574 11217 102 730 22556
3373 102 336 5160 102 805 30357 102 223 1358 102 252 3042 102 844 33702
3374 102 234 1816 102 711 20384 102 792 28758 102 938 41836 102 102 102
3375 102 768 25613 102 250 2790 102 627 13069 102 768 24845 102 160 927
3376 102 607 11824 102 660 16277 102 667 16944 {} {} {} 102 257 3555
3377 102 572 10643 102 716 21100 102 870 35417 102 934 39960 102 133 461
3378 102 330 4489 102 443 9111 102 633 14331 102 158 767 102 840 32858
3379 102 911 38097 102 938 40898 102 480 9591 102 786 27176
3380 102 963 43758 102 113 328 102 309 4159 102 354 5860 102 671 18285
3381 102 726 21826 102 959 42795 102 393 6608 102 634 14965 102 247 2540
3382 102 412 7817 102 430 8668 102 670 17614 102 794 29552 102 113 215
3383 102 224 1582 102 762 24077 102 870 36287 102 256 3298 102 335 4824
3384 102 346 5506 102 822 31179}
3386 do_execsql_test 2.4.1 {
3387 SELECT row_number() OVER win
3391 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES
3393 } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
3394 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
3395 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
3396 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
3397 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
3400 do_execsql_test 2.4.2 {
3401 SELECT nth_value(c, 14) OVER win
3405 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES
3407 } {247 247 247 247 247 247 247 247 247 247 247 247 247
3408 247 247 247 247 247 247 247 247 247 247 247 247 247
3409 247 247 247 247 247 247 247 247 247 247 247 247 247
3410 247 247 247 247 247 247 247 247 247 247 247 247 247
3411 247 247 247 247 247 247 247 247 247 247 247 247 247
3412 247 247 247 247 247 247 247 247 247 247 247 247 247
3415 do_execsql_test 2.4.3 {
3416 SELECT min(c) OVER win, max(c) OVER win, sum(c) OVER win FROM t3
3419 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES
3421 } {102 223 1358 102 239 2293 102 911 38097 102 934 39960 102 309 4159
3422 102 572 10643 102 627 13069 102 870 35417 102 247 2540 102 393 6608
3423 102 399 7405 102 412 7817 102 660 16277 102 762 24077 102 633 14331
3424 102 705 19673 102 711 20384 102 786 27176 102 792 28758
3425 102 840 32858 102 158 767 102 430 8668 102 607 11824 102 759 23315
3426 102 346 5506 102 822 31179 102 224 1582 102 256 3298 102 845 34547
3427 102 238 2054 102 716 21100 102 794 29552 102 959 42795 102 113 215
3428 102 777 26390 102 252 3042 102 629 13698 102 768 25613 102 208 1135
3429 102 618 12442 102 667 16944 102 670 17614 102 102 102 102 295 3850
3430 102 574 11217 102 726 21826 102 870 36287 102 938 40898 102 148 609
3431 102 335 4824 102 480 9591 102 634 14965 102 160 927 102 844 33702
3432 102 929 39026 102 938 41836 102 480 10071 102 790 27966
3433 102 979 44737 102 133 461 102 330 4489 102 355 6215 102 683 18968
3434 102 730 22556 102 963 43758 102 398 7006 102 652 15617 102 250 2790
3435 102 421 8238 102 443 9111 102 671 18285 102 805 30357 102 113 328
3436 102 234 1816 102 768 24845 102 899 37186 102 257 3555 102 336 5160
3437 102 354 5860 102 839 32018}
3439 #==========================================================================
3441 do_execsql_test 3.0 {
3442 DROP TABLE IF EXISTS t1;
3443 CREATE TABLE t1(a REAL, b INTEGER);
3444 INSERT INTO t1 VALUES
3445 (5, 10), (10, 20), (13, 26), (13, 26),
3446 (15, 30), (20, 40), (22,80), (30, 90);
3449 do_execsql_test 3.1 {
3450 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 5 PRECEDING AND 5 FOLLOWING )
3451 } {5 30 10 112 13 102 13 102 15 142 20 150 22 120 30 90}
3453 do_execsql_test 3.2 {
3454 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 10 PRECEDING AND 5 PRECEDING )
3455 } {5 {} 10 10 13 10 13 10 15 30 20 102 22 82 30 120}
3457 do_execsql_test 3.3 {
3458 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 2 FOLLOWING AND 3 FOLLOWING )
3459 } {5 {} 10 52 13 30 13 30 15 {} 20 80 22 {} 30 {}}
3461 do_execsql_test 3.4 {
3462 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 5 PRECEDING AND 5 FOLLOWING )
3463 } {30 90 22 120 20 150 15 142 13 102 13 102 10 112 5 30}
3465 do_execsql_test 3.5 {
3466 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 10 PRECEDING AND 5 PRECEDING )
3467 } {30 {} 22 90 20 90 15 120 13 120 13 120 10 70 5 102}
3469 do_execsql_test 3.6 {
3470 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 2 FOLLOWING AND 3 FOLLOWING )
3471 } {30 {} 22 40 20 {} 15 52 13 20 13 20 10 {} 5 {}}
3473 do_execsql_test 3.7 {
3474 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 5.1 PRECEDING AND 5.3 FOLLOWING )
3475 } {5 30 10 112 13 102 13 102 15 142 20 150 22 120 30 90}
3477 do_execsql_test 3.8 {
3478 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 10.2 PRECEDING AND 5.4 PRECEDING )
3479 } {5 {} 10 {} 13 10 13 10 15 10 20 72 22 82 30 120}
3481 do_execsql_test 3.9 {
3482 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE BETWEEN 2.6 FOLLOWING AND 3.5 FOLLOWING )
3483 } {5 {} 10 52 13 {} 13 {} 15 {} 20 {} 22 {} 30 {}}
3485 do_execsql_test 3.10 {
3486 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 5.7 PRECEDING AND 5.8 FOLLOWING )
3487 } {30 90 22 120 20 150 15 142 13 102 13 102 10 112 5 30}
3489 do_execsql_test 3.11 {
3490 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN UNBOUNDED PRECEDING AND 5.9 PRECEDING )
3491 } {30 {} 22 90 20 90 15 170 13 210 13 210 10 210 5 292}
3493 do_execsql_test 3.12 {
3494 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a DESC RANGE BETWEEN 2.1 FOLLOWING AND UNBOUNDED FOLLOWING )
3495 } {30 232 22 112 20 112 15 30 13 30 13 30 10 10 5 {}}
3497 do_execsql_test 3.13 {
3498 SELECT CAST(a AS INTEGER), sum(b) OVER win FROM t1 WINDOW win AS ( ORDER BY a RANGE 5.1 PRECEDING )
3499 } {5 10 10 30 13 72 13 72 15 102 20 70 22 120 30 90}
3501 #==========================================================================
3503 do_execsql_test 4.0 {
3504 DROP TABLE IF EXISTS t1;
3505 CREATE TABLE t1(a INTEGER, b INTEGER);
3506 INSERT INTO t1 VALUES
3507 (NULL, 1), (NULL, 2), (NULL, 3), (10, 4), (10, 5);
3510 do_execsql_test 4.1.1 {
3511 SELECT sum(b) OVER (
3512 ORDER BY a RANGE BETWEEN 5 PRECEDING AND 10 FOLLOWING
3513 ) FROM t1 ORDER BY 1;
3516 do_execsql_test 4.1.2 {
3517 SELECT sum(b) OVER (
3518 ORDER BY a DESC RANGE BETWEEN 5 PRECEDING AND 10 FOLLOWING
3519 ) FROM t1 ORDER BY 1;
3522 do_execsql_test 4.2.1 {
3523 SELECT sum(b) OVER (
3524 ORDER BY a RANGE BETWEEN 5 FOLLOWING AND 10 FOLLOWING
3525 ) FROM t1 ORDER BY 1 NULLS FIRST;
3528 do_execsql_test 4.2.2 {
3529 SELECT sum(b) OVER (
3530 ORDER BY a RANGE BETWEEN 5 FOLLOWING AND 10 FOLLOWING
3531 ) FROM t1 ORDER BY 1 NULLS LAST;
3534 do_execsql_test 4.2.3 {
3535 SELECT sum(b) OVER (
3536 ORDER BY a DESC RANGE BETWEEN 5 FOLLOWING AND 10 FOLLOWING
3537 ) FROM t1 ORDER BY 1 NULLS FIRST;
3540 do_execsql_test 4.2.4 {
3541 SELECT sum(b) OVER (
3542 ORDER BY a DESC RANGE BETWEEN 5 FOLLOWING AND 10 FOLLOWING
3543 ) FROM t1 ORDER BY 1 NULLS LAST;
3546 do_execsql_test 4.3.1 {
3547 SELECT sum(b) OVER (
3548 ORDER BY a NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND 10 FOLLOWING
3549 ) FROM t1 ORDER BY 1 NULLS FIRST;
3552 do_execsql_test 4.3.2 {
3553 SELECT sum(b) OVER (
3554 ORDER BY a NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND 10 FOLLOWING
3555 ) FROM t1 ORDER BY 1 NULLS LAST;
3558 do_execsql_test 4.4.1 {
3559 SELECT sum(b) OVER (
3560 ORDER BY a NULLS FIRST ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING
3561 ) FROM t1 ORDER BY 1 NULLS FIRST;
3564 do_execsql_test 4.4.2 {
3565 SELECT sum(b) OVER (
3566 ORDER BY a NULLS LAST ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING
3567 ) FROM t1 ORDER BY 1 NULLS LAST;
3570 do_execsql_test 4.4.3 {
3571 SELECT sum(b) OVER (
3572 ORDER BY a DESC NULLS LAST ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING
3573 ) FROM t1 ORDER BY 1 NULLS FIRST;
3576 do_execsql_test 4.4.4 {
3577 SELECT sum(b) OVER (
3578 ORDER BY a DESC NULLS LAST ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING
3579 ) FROM t1 ORDER BY 1 NULLS LAST;
3582 do_execsql_test 4.5.1 {
3583 SELECT sum(b) OVER (
3584 ORDER BY a ASC NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND 10 FOLLOWING
3585 ) FROM t1 ORDER BY 1 NULLS LAST;
3588 do_execsql_test 4.5.2 {
3589 SELECT sum(b) OVER (
3590 ORDER BY a DESC NULLS FIRST RANGE
3591 BETWEEN UNBOUNDED PRECEDING AND 10 FOLLOWING
3592 ) FROM t1 ORDER BY 1 NULLS LAST;
3595 #==========================================================================
3597 do_execsql_test 5.0 {
3598 INSERT INTO t3 VALUES
3599 (NULL, 'bb', 355), (NULL, 'cc', 158), (NULL, 'aa', 399),
3600 ('JJ', NULL, 839), ('FF', NULL, 618), ('BB', NULL, 393),
3601 (NULL, 'bb', 629), (NULL, NULL, 667), (NULL, NULL, 870);
3604 do_execsql_test 5.1.1.1 {
3605 SELECT max(c) OVER win,
3609 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3610 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3611 } {979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3612 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3613 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3614 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3615 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3616 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3617 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3618 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3619 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3620 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3621 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3622 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3623 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3624 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3625 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83}
3627 do_execsql_test 5.1.1.2 {
3628 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
3630 dense_rank() OVER win
3632 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3633 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3634 } {23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3635 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3636 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3637 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3638 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3639 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3640 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3641 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3642 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3643 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3644 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3645 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3646 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3647 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3648 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1}
3650 do_execsql_test 5.1.2.1 {
3651 SELECT max(c) OVER win,
3655 WINDOW win AS ( ORDER BY a NULLS FIRST
3656 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3657 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3658 } {899 113 9 899 113 9 899 113 9 899 113 9 899 113 9 899 113 9
3659 899 113 9 899 113 9 899 113 9 899 113 16 899 113 16 899 113 16
3660 899 113 16 899 113 16 899 113 16 899 113 16 979 102 44 979 102 44
3661 979 102 44 979 102 44 979 102 44 979 102 44 979 102 44 979 102 44
3662 979 102 44 979 102 44 979 102 44 979 102 49 979 102 49 979 102 49
3663 979 102 49 979 102 49 979 102 56 979 102 56 979 102 56 979 102 56
3664 979 102 56 979 102 56 979 102 56 979 102 62 979 102 62 979 102 62
3665 979 102 62 979 102 62 979 102 62 979 102 75 979 102 75 979 102 75
3666 979 102 75 979 102 75 979 102 75 979 102 75 979 102 75 979 102 75
3667 979 102 75 979 102 75 979 102 75 979 102 75 979 102 83 979 102 83
3668 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3669 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3670 979 113 25 979 113 25 979 113 25 979 113 25 979 113 25 979 113 25
3671 979 113 25 979 113 25 979 113 25 979 113 33 979 113 33 979 113 33
3672 979 113 33 979 113 33 979 113 33 979 113 33 979 113 33}
3674 do_execsql_test 5.1.2.2 {
3675 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
3677 dense_rank() OVER win
3679 WINDOW win AS ( ORDER BY a NULLS FIRST
3680 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3681 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3682 } {2947 81 11 2947 81 11 2947 81 11 2947 81 11 2947 81 11 2947 81 11
3683 2947 81 11 2947 81 11 2947 81 11 5287 74 10 5287 74 10 5287 74 10
3684 5287 74 10 5287 74 10 5287 74 10 5287 74 10 8400 65 9 8400 65 9
3685 8400 65 9 8400 65 9 8400 65 9 8400 65 9 8400 65 9 8400 65 9
3686 8400 65 9 9664 57 8 9664 57 8 9664 57 8 9664 57 8 9664 57 8
3687 9664 57 8 9664 57 8 9664 57 8 10626 46 7 10626 46 7 10626 46 7
3688 10626 46 7 10626 46 7 10626 46 7 10626 46 7 10626 46 7 10626 46 7
3689 10626 46 7 10626 46 7 12145 41 6 12145 41 6 12145 41 6 12145 41 6
3690 12145 41 6 13949 34 5 13949 34 5 13949 34 5 13949 34 5 13949 34 5
3691 13949 34 5 13949 34 5 15315 28 4 15315 28 4 15315 28 4 15315 28 4
3692 15315 28 4 15315 28 4 18796 15 3 18796 15 3 18796 15 3 18796 15 3
3693 18796 15 3 18796 15 3 18796 15 3 18796 15 3 18796 15 3 18796 15 3
3694 18796 15 3 18796 15 3 18796 15 3 21105 7 2 21105 7 2 21105 7 2
3695 21105 7 2 21105 7 2 21105 7 2 21105 7 2 21105 7 2 23155 1 1
3696 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1}
3698 do_execsql_test 5.1.3.1 {
3699 SELECT max(c) OVER win,
3703 WINDOW win AS ( PARTITION BY coalesce(a, '')
3704 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3705 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3706 } {777 113 5 777 113 5 777 113 5 777 113 5 777 113 5 805 250 7
3707 805 250 7 805 250 7 805 250 7 805 250 7 805 250 7 805 250 7
3708 822 158 6 822 158 6 822 158 6 822 158 6 822 158 6 822 158 6
3709 840 247 13 840 247 13 840 247 13 840 247 13 840 247 13 840 247 13
3710 840 247 13 840 247 13 840 247 13 840 247 13 840 247 13 840 247 13
3711 840 247 13 870 158 0 870 158 0 870 158 0 870 158 0 870 158 0
3712 870 158 0 899 113 9 899 113 9 899 113 9 899 113 9 899 113 9
3713 899 113 9 899 113 9 899 113 9 899 113 9 934 223 8 934 223 8
3714 934 223 8 934 223 8 934 223 8 934 223 8 934 223 8 934 223 8
3715 938 102 11 938 102 11 938 102 11 938 102 11 938 102 11 938 102 11
3716 938 102 11 938 102 11 938 102 11 938 102 11 938 102 11 938 148 8
3717 938 148 8 938 148 8 938 148 8 938 148 8 938 148 8 938 148 8
3718 938 148 8 959 224 7 959 224 7 959 224 7 959 224 7 959 224 7
3719 959 224 7 959 224 7 979 133 9 979 133 9 979 133 9 979 133 9
3720 979 133 9 979 133 9 979 133 9 979 133 9 979 133 9}
3722 do_execsql_test 5.1.3.2 {
3723 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
3725 dense_rank() OVER win
3727 WINDOW win AS ( PARTITION BY coalesce(a, '')
3728 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3729 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3730 } {962 1 1 962 1 1 962 1 1 962 1 1 962 1 1 962 1 1 962 1 1
3731 962 1 1 962 1 1 962 1 1 962 1 1 1264 1 1 1264 1 1 1264 1 1
3732 1264 1 1 1264 1 1 1264 1 1 1264 1 1 1264 1 1 1366 1 1 1366 1 1
3733 1366 1 1 1366 1 1 1366 1 1 1366 1 1 1519 1 1 1519 1 1 1519 1 1
3734 1519 1 1 1519 1 1 1804 1 1 1804 1 1 1804 1 1 1804 1 1 1804 1 1
3735 1804 1 1 1804 1 1 2050 1 1 2050 1 1 2050 1 1 2050 1 1 2050 1 1
3736 2050 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1
3737 2309 1 1 2309 1 1 2340 1 1 2340 1 1 2340 1 1 2340 1 1 2340 1 1
3738 2340 1 1 2340 1 1 2947 1 1 2947 1 1 2947 1 1 2947 1 1 2947 1 1
3739 2947 1 1 2947 1 1 2947 1 1 2947 1 1 3113 1 1 3113 1 1 3113 1 1
3740 3113 1 1 3113 1 1 3113 1 1 3113 1 1 3113 1 1 3113 1 1 3481 1 1
3741 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1
3742 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1}
3744 do_execsql_test 5.1.4.1 {
3745 SELECT max(c) OVER win,
3749 WINDOW win AS ( ORDER BY a NULLS FIRST GROUPS 6 PRECEDING EXCLUDE NO OTHERS )
3750 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3751 } {870 158 0 870 158 0 870 158 0 870 158 0 870 158 0 870 158 0
3752 934 158 8 934 158 8 934 158 8 934 158 8 934 158 8 934 158 8
3753 934 158 8 934 158 8 934 158 21 934 158 21 934 158 21 934 158 21
3754 934 158 21 934 158 21 934 158 21 934 158 21 934 158 21 934 158 21
3755 934 158 21 934 158 21 934 158 21 934 158 27 934 158 27 934 158 27
3756 934 158 27 934 158 27 934 158 27 959 102 50 959 102 50 959 102 50
3757 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50
3758 959 102 50 959 102 50 959 102 58 959 102 58 959 102 58 959 102 58
3759 959 102 58 959 102 58 959 102 58 959 102 58 959 113 39 959 113 39
3760 959 113 39 959 113 39 959 113 39 959 158 34 959 158 34 959 158 34
3761 959 158 34 959 158 34 959 158 34 959 158 34 979 102 53 979 102 53
3762 979 102 53 979 102 53 979 102 53 979 102 53 979 102 53 979 102 56
3763 979 102 56 979 102 56 979 102 56 979 102 56 979 102 56 979 102 56
3764 979 102 56 979 102 56 979 102 59 979 102 59 979 102 59 979 102 59
3765 979 102 59 979 102 59 979 102 59 979 102 59 979 102 59}
3767 do_execsql_test 5.1.4.2 {
3768 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
3770 dense_rank() OVER win
3772 WINDOW win AS ( ORDER BY a NULLS FIRST GROUPS 6 PRECEDING EXCLUDE NO OTHERS )
3773 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3774 } {2050 1 1 2050 1 1 2050 1 1 2050 1 1 2050 1 1 2050 1 1 4359 7 2
3775 4359 7 2 4359 7 2 4359 7 2 4359 7 2 4359 7 2 4359 7 2 4359 7 2
3776 7840 15 3 7840 15 3 7840 15 3 7840 15 3 7840 15 3 7840 15 3
3777 7840 15 3 7840 15 3 7840 15 3 7840 15 3 7840 15 3 7840 15 3
3778 7840 15 3 9206 28 4 9206 28 4 9206 28 4 9206 28 4 9206 28 4
3779 9206 28 4 11010 34 5 11010 34 5 11010 34 5 11010 34 5 11010 34 5
3780 11010 34 5 11010 34 5 12368 74 10 12368 74 10 12368 74 10
3781 12368 74 10 12368 74 10 12368 74 10 12368 74 10 12529 41 6
3782 12529 41 6 12529 41 6 12529 41 6 12529 41 6 12705 57 8 12705 57 8
3783 12705 57 8 12705 57 8 12705 57 8 12705 57 8 12705 57 8 12705 57 8
3784 13491 46 7 13491 46 7 13491 46 7 13491 46 7 13491 46 7 13491 46 7
3785 13491 46 7 13491 46 7 13491 46 7 13491 46 7 13491 46 7 13509 65 9
3786 13509 65 9 13509 65 9 13509 65 9 13509 65 9 13509 65 9 13509 65 9
3787 13509 65 9 13509 65 9 13949 81 11 13949 81 11 13949 81 11
3788 13949 81 11 13949 81 11 13949 81 11 13949 81 11 13949 81 11
3791 do_execsql_test 5.1.5.1 {
3792 SELECT max(c) OVER win,
3796 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE NO OTHERS )
3797 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3798 } {102 102 1 113 113 2 113 113 2 133 133 1 148 148 1 160 158 2
3799 160 158 2 160 158 2 208 208 1 224 223 2 224 223 2 239 234 3
3800 239 234 3 239 234 3 252 247 3 257 247 5 257 247 5 257 250 4
3801 257 252 3 295 295 1 309 309 1 336 330 3 336 330 3 336 330 3
3802 346 346 1 355 354 2 355 354 2 355 354 2 399 393 4 399 393 4
3803 399 393 4 399 393 4 399 393 4 412 412 1 421 421 1 430 430 1
3804 443 443 1 480 480 2 480 480 2 574 572 2 574 572 2 607 607 1
3805 618 618 2 618 618 2 634 627 4 634 627 4 634 627 4 634 627 4
3806 634 629 3 652 652 1 667 660 2 671 667 3 671 667 3 671 667 3
3807 671 667 3 683 683 1 711 705 2 716 705 3 716 711 2 730 726 2
3808 730 726 2 762 759 2 768 759 4 768 762 3 768 762 3 777 777 1
3809 792 786 3 794 786 4 794 786 4 794 790 3 805 805 1 822 822 1
3810 845 839 5 845 839 5 845 839 5 845 839 5 845 839 5 870 870 2
3811 870 870 2 870 870 2 899 899 1 911 911 1 934 929 2 938 929 4
3812 938 934 3 938 934 3 963 959 2 963 959 2 979 979 1}
3814 do_execsql_test 5.1.5.2 {
3815 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
3817 dense_rank() OVER win
3819 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE NO OTHERS )
3820 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3821 } {{} 1 1 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 25 23 {} 34 29
3822 {} 36 31 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 43 37 {} 43 37
3823 {} 50 42 {} 60 51 {} 61 52 {} 64 55 {} 64 55 {} 67 57 {} 68 58
3824 {} 69 59 {} 70 60 {} 72 62 {} 78 67 {} 78 67 {} 78 67 {} 85 72
3825 {} 85 72 133 4 3 223 10 8 223 11 9 226 2 2 226 2 2 239 12 10
3826 239 13 11 239 14 12 247 15 13 257 18 16 257 19 17 295 20 18
3827 309 21 19 335 22 20 335 23 21 335 24 22 421 35 30 443 37 32
3828 504 16 14 504 17 15 607 42 36 683 56 47 710 26 24 710 27 25
3829 710 27 25 711 59 50 759 62 53 759 63 54 777 66 56 805 71 61
3830 899 81 68 911 82 69 929 83 70 929 84 71 979 89 75 1334 51 43
3831 1416 57 48 1416 58 49 1584 29 26 1584 29 26 1584 31 27 1584 32 28
3832 1584 32 28 1891 49 41 1922 87 73 1922 88 74 2005 52 44 2005 52 44
3833 2005 54 45 2005 55 46 2518 45 38 2518 46 39 2518 46 39 2518 48 40
3834 2523 73 63 2523 73 63 2523 75 64 2523 76 65 2523 77 66}
3836 do_execsql_test 5.1.6.1 {
3837 SELECT max(c) OVER win,
3841 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE NO OTHERS )
3842 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3843 } {102 102 1 113 113 2 113 113 2 133 133 1 148 148 1 158 158 1
3844 158 158 1 160 160 1 208 208 1 223 223 1 224 224 1 234 234 1
3845 238 238 1 239 239 1 247 247 1 250 250 1 252 252 1 256 256 1
3846 257 257 1 295 295 1 309 309 1 330 330 1 335 335 1 336 336 1
3847 346 346 1 354 354 1 355 355 1 355 355 1 393 393 2 393 393 2
3848 398 398 1 399 399 1 399 399 1 412 412 1 421 421 1 430 430 1
3849 443 443 1 480 480 2 480 480 2 572 572 1 574 574 1 607 607 1
3850 618 618 2 618 618 2 627 627 1 629 629 1 629 629 1 633 633 1
3851 634 634 1 652 652 1 660 660 1 667 667 1 667 667 1 670 670 1
3852 671 671 1 683 683 1 705 705 1 711 711 1 716 716 1 726 726 1
3853 730 730 1 759 759 1 762 762 1 768 768 2 768 768 2 777 777 1
3854 786 786 1 790 790 1 792 792 1 794 794 1 805 805 1 822 822 1
3855 839 839 2 839 839 2 840 840 1 844 844 1 845 845 1 870 870 2
3856 870 870 2 870 870 2 899 899 1 911 911 1 929 929 1 934 934 1
3857 938 938 2 938 938 2 959 959 1 963 963 1 979 979 1}
3859 do_execsql_test 5.1.6.2 {
3860 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
3862 dense_rank() OVER win
3864 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE NO OTHERS )
3865 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3866 } {{} 1 1 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 11 9 {} 12 10
3867 {} 13 11 {} 16 14 {} 17 15 {} 18 16 {} 22 20 {} 24 22 {} 25 23
3868 {} 26 24 {} 31 27 {} 34 29 {} 36 31 {} 38 33 {} 38 33 {} 40 34
3869 {} 41 35 {} 43 37 {} 43 37 {} 49 41 {} 50 42 {} 51 43 {} 54 45
3870 {} 59 50 {} 60 51 {} 61 52 {} 63 54 {} 64 55 {} 64 55 {} 67 57
3871 {} 68 58 {} 69 59 {} 70 60 {} 72 62 {} 75 64 {} 76 65 {} 78 67
3872 {} 78 67 {} 78 67 {} 84 71 {} 85 72 {} 85 72 133 4 3 223 10 8
3873 226 2 2 226 2 2 239 14 12 247 15 13 257 19 17 295 20 18
3874 309 21 19 335 23 21 421 35 30 443 37 32 607 42 36 627 45 38
3875 633 48 40 671 55 46 683 56 47 705 57 48 710 27 25 710 27 25
3876 711 58 49 759 62 53 777 66 56 786 29 26 786 29 26 798 32 28
3877 798 32 28 805 71 61 845 77 66 899 81 68 911 82 69 929 83 70
3878 959 87 73 963 88 74 979 89 75 1258 46 39 1258 46 39 1334 52 44
3879 1334 52 44 1678 73 63 1678 73 63}
3881 do_execsql_test 5.1.7.1 {
3882 SELECT max(c) OVER win,
3886 WINDOW win AS ( ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
3887 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3888 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3889 } {979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3890 979 102 83 979 113 81 979 113 82 979 133 80 979 148 79 979 158 77
3891 979 158 78 979 160 77 979 208 76 979 223 75 979 224 74 979 234 73
3892 979 238 72 979 239 71 979 247 70 979 250 69 979 252 68 979 256 67
3893 979 257 66 979 295 65 979 309 64 979 330 63 979 335 62 979 336 61
3894 979 346 60 979 354 59 979 355 58 979 355 58 979 393 56 979 393 57
3895 979 398 55 979 399 54 979 399 54 979 412 53 979 421 52 979 430 51
3896 979 443 50 979 480 48 979 480 49 979 572 47 979 574 46 979 607 45
3897 979 618 43 979 618 44 979 627 42 979 629 41 979 629 41 979 633 40
3898 979 634 39 979 652 38 979 660 37 979 667 36 979 667 36 979 670 35
3899 979 671 34 979 683 33 979 705 32 979 711 31 979 716 30 979 726 29
3900 979 730 28 979 759 27 979 762 26 979 768 24 979 768 25 979 777 23
3901 979 786 22 979 790 21 979 792 20 979 794 19 979 805 18 979 822 17
3902 979 839 15 979 839 16 979 840 14 979 844 13 979 845 12 979 870 10
3903 979 870 11 979 870 11 979 899 9 979 911 8 979 929 7}
3905 do_execsql_test 5.1.7.2 {
3906 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
3908 dense_rank() OVER win
3910 WINDOW win AS ( ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
3911 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3912 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3913 } {3830 89 89 4741 88 88 5640 84 84 5640 85 85 5640 86 86 5640 87 87
3914 6485 81 81 6485 82 82 6485 83 83 7324 80 80 8163 78 78 8163 79 79
3915 8968 73 73 8968 74 74 8968 75 75 8968 76 76 8968 77 77 9745 69 69
3916 9745 70 70 9745 71 71 9745 72 72 10504 65 65 10504 66 66
3917 10504 67 67 10504 68 68 11215 64 64 11920 63 63 12603 62 62
3918 13274 60 60 13274 61 61 13941 59 59 14608 55 55 14608 56 56
3919 14608 57 57 14608 58 58 15241 54 54 15870 53 53 16499 52 52
3920 17126 49 49 17126 50 50 17126 51 51 17733 44 44 17733 45 45
3921 17733 46 46 17733 47 47 17733 48 48 18176 42 42 18176 43 43
3922 18597 40 40 18597 41 41 18996 39 39 19395 37 37 19395 38 38
3923 19788 36 36 20181 35 35 20536 34 34 20891 30 30 20891 31 31
3924 20891 32 32 20891 33 33 21226 28 28 21226 29 29 21535 27 27
3925 21830 26 26 22087 22 22 22087 23 23 22087 24 24 22087 25 25
3926 22334 21 21 22573 17 17 22573 18 18 22573 19 19 22573 20 20
3927 22796 11 11 22796 12 12 22796 13 13 22796 14 14 22796 15 15
3928 22796 16 16 22929 10 10 23042 9 9 23155 1 1 23155 2 2 23155 3 3
3929 23155 4 4 23155 5 5 23155 6 6 23155 7 7 23155 8 8}
3931 do_execsql_test 5.1.8.1 {
3932 SELECT max(c) OVER win,
3936 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3937 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3938 } {979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3939 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3940 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3941 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3942 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3943 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3944 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3945 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3946 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3947 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3948 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3949 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3950 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3951 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3952 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83}
3954 do_execsql_test 5.1.8.2 {
3955 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
3957 dense_rank() OVER win
3959 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3960 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3961 } {23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3962 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3963 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3964 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3965 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3966 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3967 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3968 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3969 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3970 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3971 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3972 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3973 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3974 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
3975 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1}
3977 do_execsql_test 5.1.9.1 {
3978 SELECT max(c) OVER win,
3982 WINDOW win AS ( ORDER BY a NULLS LAST
3983 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
3984 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
3985 } {870 158 0 870 158 0 870 158 0 870 158 0 870 158 0 870 158 0
3986 899 113 9 899 113 9 899 113 9 899 113 9 899 113 9 899 113 9
3987 899 113 9 899 113 9 899 113 9 899 113 16 899 113 16 899 113 16
3988 899 113 16 899 113 16 899 113 16 899 113 16 979 102 44 979 102 44
3989 979 102 44 979 102 44 979 102 44 979 102 44 979 102 44 979 102 44
3990 979 102 44 979 102 44 979 102 44 979 102 49 979 102 49 979 102 49
3991 979 102 49 979 102 49 979 102 56 979 102 56 979 102 56 979 102 56
3992 979 102 56 979 102 56 979 102 56 979 102 62 979 102 62 979 102 62
3993 979 102 62 979 102 62 979 102 62 979 102 75 979 102 75 979 102 75
3994 979 102 75 979 102 75 979 102 75 979 102 75 979 102 75 979 102 75
3995 979 102 75 979 102 75 979 102 75 979 102 75 979 102 83 979 102 83
3996 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
3997 979 113 25 979 113 25 979 113 25 979 113 25 979 113 25 979 113 25
3998 979 113 25 979 113 25 979 113 25 979 113 33 979 113 33 979 113 33
3999 979 113 33 979 113 33 979 113 33 979 113 33 979 113 33}
4001 do_execsql_test 5.1.9.2 {
4002 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4004 dense_rank() OVER win
4006 WINDOW win AS ( ORDER BY a NULLS LAST
4007 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
4008 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4009 } {2050 84 11 2050 84 11 2050 84 11 2050 84 11 2050 84 11 2050 84 11
4010 4997 75 10 4997 75 10 4997 75 10 4997 75 10 4997 75 10 4997 75 10
4011 4997 75 10 4997 75 10 4997 75 10 7337 68 9 7337 68 9 7337 68 9
4012 7337 68 9 7337 68 9 7337 68 9 7337 68 9 10450 59 8 10450 59 8
4013 10450 59 8 10450 59 8 10450 59 8 10450 59 8 10450 59 8 10450 59 8
4014 10450 59 8 11714 51 7 11714 51 7 11714 51 7 11714 51 7 11714 51 7
4015 11714 51 7 11714 51 7 11714 51 7 12676 40 6 12676 40 6 12676 40 6
4016 12676 40 6 12676 40 6 12676 40 6 12676 40 6 12676 40 6 12676 40 6
4017 12676 40 6 12676 40 6 14195 35 5 14195 35 5 14195 35 5 14195 35 5
4018 14195 35 5 15999 28 4 15999 28 4 15999 28 4 15999 28 4 15999 28 4
4019 15999 28 4 15999 28 4 17365 22 3 17365 22 3 17365 22 3 17365 22 3
4020 17365 22 3 17365 22 3 20846 9 2 20846 9 2 20846 9 2 20846 9 2
4021 20846 9 2 20846 9 2 20846 9 2 20846 9 2 20846 9 2 20846 9 2
4022 20846 9 2 20846 9 2 20846 9 2 23155 1 1 23155 1 1 23155 1 1
4023 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1}
4025 do_execsql_test 5.1.10.1 {
4026 SELECT max(c) OVER win,
4030 WINDOW win AS ( PARTITION BY coalesce(a, '')
4031 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
4032 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4033 } {777 113 5 777 113 5 777 113 5 777 113 5 777 113 5 805 250 7
4034 805 250 7 805 250 7 805 250 7 805 250 7 805 250 7 805 250 7
4035 822 158 6 822 158 6 822 158 6 822 158 6 822 158 6 822 158 6
4036 840 247 13 840 247 13 840 247 13 840 247 13 840 247 13 840 247 13
4037 840 247 13 840 247 13 840 247 13 840 247 13 840 247 13 840 247 13
4038 840 247 13 870 158 0 870 158 0 870 158 0 870 158 0 870 158 0
4039 870 158 0 899 113 9 899 113 9 899 113 9 899 113 9 899 113 9
4040 899 113 9 899 113 9 899 113 9 899 113 9 934 223 8 934 223 8
4041 934 223 8 934 223 8 934 223 8 934 223 8 934 223 8 934 223 8
4042 938 102 11 938 102 11 938 102 11 938 102 11 938 102 11 938 102 11
4043 938 102 11 938 102 11 938 102 11 938 102 11 938 102 11 938 148 8
4044 938 148 8 938 148 8 938 148 8 938 148 8 938 148 8 938 148 8
4045 938 148 8 959 224 7 959 224 7 959 224 7 959 224 7 959 224 7
4046 959 224 7 959 224 7 979 133 9 979 133 9 979 133 9 979 133 9
4047 979 133 9 979 133 9 979 133 9 979 133 9 979 133 9}
4049 do_execsql_test 5.1.10.2 {
4050 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4052 dense_rank() OVER win
4054 WINDOW win AS ( PARTITION BY coalesce(a, '')
4055 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
4056 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4057 } {962 1 1 962 1 1 962 1 1 962 1 1 962 1 1 962 1 1 962 1 1
4058 962 1 1 962 1 1 962 1 1 962 1 1 1264 1 1 1264 1 1 1264 1 1
4059 1264 1 1 1264 1 1 1264 1 1 1264 1 1 1264 1 1 1366 1 1 1366 1 1
4060 1366 1 1 1366 1 1 1366 1 1 1366 1 1 1519 1 1 1519 1 1 1519 1 1
4061 1519 1 1 1519 1 1 1804 1 1 1804 1 1 1804 1 1 1804 1 1 1804 1 1
4062 1804 1 1 1804 1 1 2050 1 1 2050 1 1 2050 1 1 2050 1 1 2050 1 1
4063 2050 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1
4064 2309 1 1 2309 1 1 2340 1 1 2340 1 1 2340 1 1 2340 1 1 2340 1 1
4065 2340 1 1 2340 1 1 2947 1 1 2947 1 1 2947 1 1 2947 1 1 2947 1 1
4066 2947 1 1 2947 1 1 2947 1 1 2947 1 1 3113 1 1 3113 1 1 3113 1 1
4067 3113 1 1 3113 1 1 3113 1 1 3113 1 1 3113 1 1 3113 1 1 3481 1 1
4068 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1
4069 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1}
4071 do_execsql_test 5.1.11.1 {
4072 SELECT max(c) OVER win,
4076 WINDOW win AS ( ORDER BY a NULLS LAST GROUPS 6 PRECEDING EXCLUDE NO OTHERS )
4077 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4078 } {934 158 27 934 158 27 934 158 27 934 158 27 934 158 27 934 158 27
4079 934 223 8 934 223 8 934 223 8 934 223 8 934 223 8 934 223 8
4080 934 223 8 934 223 8 934 223 21 934 223 21 934 223 21 934 223 21
4081 934 223 21 934 223 21 934 223 21 934 223 21 934 223 21 934 223 21
4082 934 223 21 934 223 21 934 223 21 959 102 50 959 102 50 959 102 50
4083 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50
4084 959 102 50 959 102 50 959 102 58 959 102 58 959 102 58 959 102 58
4085 959 102 58 959 102 58 959 102 58 959 102 58 959 113 39 959 113 39
4086 959 113 39 959 113 39 959 113 39 959 158 34 959 158 34 959 158 34
4087 959 158 34 959 158 34 959 158 34 959 158 34 979 102 49 979 102 49
4088 979 102 49 979 102 49 979 102 49 979 102 49 979 102 53 979 102 53
4089 979 102 53 979 102 53 979 102 53 979 102 53 979 102 53 979 102 56
4090 979 102 56 979 102 56 979 102 56 979 102 56 979 102 56 979 102 56
4091 979 102 56 979 102 56 979 102 59 979 102 59 979 102 59 979 102 59
4092 979 102 59 979 102 59 979 102 59 979 102 59 979 102 59}
4094 do_execsql_test 5.1.11.2 {
4095 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4097 dense_rank() OVER win
4099 WINDOW win AS ( ORDER BY a NULLS LAST GROUPS 6 PRECEDING EXCLUDE NO OTHERS )
4100 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4101 } {2309 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1 2309 1 1
4102 2309 1 1 5790 9 2 5790 9 2 5790 9 2 5790 9 2 5790 9 2 5790 9 2
4103 5790 9 2 5790 9 2 5790 9 2 5790 9 2 5790 9 2 5790 9 2 5790 9 2
4104 7156 22 3 7156 22 3 7156 22 3 7156 22 3 7156 22 3 7156 22 3
4105 8960 28 4 8960 28 4 8960 28 4 8960 28 4 8960 28 4 8960 28 4
4106 8960 28 4 10479 35 5 10479 35 5 10479 35 5 10479 35 5 10479 35 5
4107 11441 40 6 11441 40 6 11441 40 6 11441 40 6 11441 40 6 11441 40 6
4108 11441 40 6 11441 40 6 11441 40 6 11441 40 6 11441 40 6 12368 68 9
4109 12368 68 9 12368 68 9 12368 68 9 12368 68 9 12368 68 9 12368 68 9
4110 12705 51 7 12705 51 7 12705 51 7 12705 51 7 12705 51 7 12705 51 7
4111 12705 51 7 12705 51 7 13509 59 8 13509 59 8 13509 59 8 13509 59 8
4112 13509 59 8 13509 59 8 13509 59 8 13509 59 8 13509 59 8
4113 13949 75 10 13949 75 10 13949 75 10 13949 75 10 13949 75 10
4114 13949 75 10 13949 75 10 13949 75 10 13949 75 10 14195 84 11
4115 14195 84 11 14195 84 11 14195 84 11 14195 84 11 14195 84 11}
4117 do_execsql_test 5.1.12.1 {
4118 SELECT max(c) OVER win,
4122 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE NO OTHERS )
4123 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4124 } {102 102 1 113 113 2 113 113 2 133 133 1 148 148 1 160 158 2
4125 160 158 2 160 158 2 208 208 1 224 223 2 224 223 2 239 234 3
4126 239 234 3 239 234 3 252 247 3 257 247 5 257 247 5 257 250 4
4127 257 252 3 295 295 1 309 309 1 336 330 3 336 330 3 336 330 3
4128 346 346 1 355 354 2 355 354 2 355 354 2 399 393 4 399 393 4
4129 399 393 4 399 393 4 399 393 4 412 412 1 421 421 1 430 430 1
4130 443 443 1 480 480 2 480 480 2 574 572 2 574 572 2 607 607 1
4131 618 618 2 618 618 2 634 627 4 634 627 4 634 627 4 634 627 4
4132 634 629 3 652 652 1 667 660 2 671 667 3 671 667 3 671 667 3
4133 671 667 3 683 683 1 711 705 2 716 705 3 716 711 2 730 726 2
4134 730 726 2 762 759 2 768 759 4 768 762 3 768 762 3 777 777 1
4135 792 786 3 794 786 4 794 786 4 794 790 3 805 805 1 822 822 1
4136 845 839 5 845 839 5 845 839 5 845 839 5 845 839 5 870 870 2
4137 870 870 2 870 870 2 899 899 1 911 911 1 934 929 2 938 929 4
4138 938 934 3 938 934 3 963 959 2 963 959 2 979 979 1}
4140 do_execsql_test 5.1.12.2 {
4141 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4143 dense_rank() OVER win
4145 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE NO OTHERS )
4146 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4147 } {{} 1 1 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 25 23 {} 34 29
4148 {} 36 31 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 43 37 {} 43 37
4149 {} 50 42 {} 60 51 {} 61 52 {} 64 55 {} 64 55 {} 67 57 {} 68 58
4150 {} 69 59 {} 70 60 {} 72 62 {} 78 67 {} 78 67 {} 78 67 {} 85 72
4151 {} 85 72 133 4 3 223 10 8 223 11 9 226 2 2 226 2 2 239 12 10
4152 239 13 11 239 14 12 247 15 13 257 18 16 257 19 17 295 20 18
4153 309 21 19 335 22 20 335 23 21 335 24 22 421 35 30 443 37 32
4154 504 16 14 504 17 15 607 42 36 683 56 47 710 26 24 710 27 25
4155 710 27 25 711 59 50 759 62 53 759 63 54 777 66 56 805 71 61
4156 899 81 68 911 82 69 929 83 70 929 84 71 979 89 75 1334 51 43
4157 1416 57 48 1416 58 49 1584 29 26 1584 29 26 1584 31 27 1584 32 28
4158 1584 32 28 1891 49 41 1922 87 73 1922 88 74 2005 52 44 2005 52 44
4159 2005 54 45 2005 55 46 2518 45 38 2518 46 39 2518 46 39 2518 48 40
4160 2523 73 63 2523 73 63 2523 75 64 2523 76 65 2523 77 66}
4162 do_execsql_test 5.1.13.1 {
4163 SELECT max(c) OVER win,
4167 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE NO OTHERS )
4168 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4169 } {102 102 1 113 113 2 113 113 2 133 133 1 148 148 1 158 158 1
4170 158 158 1 160 160 1 208 208 1 223 223 1 224 224 1 234 234 1
4171 238 238 1 239 239 1 247 247 1 250 250 1 252 252 1 256 256 1
4172 257 257 1 295 295 1 309 309 1 330 330 1 335 335 1 336 336 1
4173 346 346 1 354 354 1 355 355 1 355 355 1 393 393 2 393 393 2
4174 398 398 1 399 399 1 399 399 1 412 412 1 421 421 1 430 430 1
4175 443 443 1 480 480 2 480 480 2 572 572 1 574 574 1 607 607 1
4176 618 618 2 618 618 2 627 627 1 629 629 1 629 629 1 633 633 1
4177 634 634 1 652 652 1 660 660 1 667 667 1 667 667 1 670 670 1
4178 671 671 1 683 683 1 705 705 1 711 711 1 716 716 1 726 726 1
4179 730 730 1 759 759 1 762 762 1 768 768 2 768 768 2 777 777 1
4180 786 786 1 790 790 1 792 792 1 794 794 1 805 805 1 822 822 1
4181 839 839 2 839 839 2 840 840 1 844 844 1 845 845 1 870 870 2
4182 870 870 2 870 870 2 899 899 1 911 911 1 929 929 1 934 934 1
4183 938 938 2 938 938 2 959 959 1 963 963 1 979 979 1}
4185 do_execsql_test 5.1.13.2 {
4186 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4188 dense_rank() OVER win
4190 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE NO OTHERS )
4191 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4192 } {{} 1 1 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 11 9 {} 12 10
4193 {} 13 11 {} 16 14 {} 17 15 {} 18 16 {} 22 20 {} 24 22 {} 25 23
4194 {} 26 24 {} 31 27 {} 34 29 {} 36 31 {} 38 33 {} 38 33 {} 40 34
4195 {} 41 35 {} 43 37 {} 43 37 {} 49 41 {} 50 42 {} 51 43 {} 54 45
4196 {} 59 50 {} 60 51 {} 61 52 {} 63 54 {} 64 55 {} 64 55 {} 67 57
4197 {} 68 58 {} 69 59 {} 70 60 {} 72 62 {} 75 64 {} 76 65 {} 78 67
4198 {} 78 67 {} 78 67 {} 84 71 {} 85 72 {} 85 72 133 4 3 223 10 8
4199 226 2 2 226 2 2 239 14 12 247 15 13 257 19 17 295 20 18
4200 309 21 19 335 23 21 421 35 30 443 37 32 607 42 36 627 45 38
4201 633 48 40 671 55 46 683 56 47 705 57 48 710 27 25 710 27 25
4202 711 58 49 759 62 53 777 66 56 786 29 26 786 29 26 798 32 28
4203 798 32 28 805 71 61 845 77 66 899 81 68 911 82 69 929 83 70
4204 959 87 73 963 88 74 979 89 75 1258 46 39 1258 46 39 1334 52 44
4205 1334 52 44 1678 73 63 1678 73 63}
4207 do_execsql_test 5.1.14.1 {
4208 SELECT max(c) OVER win,
4212 WINDOW win AS ( ORDER BY c NULLS LAST, b NULLS LAST, a NULLS LAST
4213 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
4214 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4215 } {979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
4216 979 102 83 979 113 81 979 113 82 979 133 80 979 148 79 979 158 77
4217 979 158 78 979 160 77 979 208 76 979 223 75 979 224 74 979 234 73
4218 979 238 72 979 239 71 979 247 70 979 250 69 979 252 68 979 256 67
4219 979 257 66 979 295 65 979 309 64 979 330 63 979 335 62 979 336 61
4220 979 346 60 979 354 59 979 355 57 979 355 58 979 393 56 979 393 57
4221 979 398 55 979 399 53 979 399 54 979 412 53 979 421 52 979 430 51
4222 979 443 50 979 480 48 979 480 49 979 572 47 979 574 46 979 607 45
4223 979 618 43 979 618 44 979 627 42 979 629 40 979 629 41 979 633 40
4224 979 634 39 979 652 38 979 660 37 979 667 35 979 667 36 979 670 35
4225 979 671 34 979 683 33 979 705 32 979 711 31 979 716 30 979 726 29
4226 979 730 28 979 759 27 979 762 26 979 768 24 979 768 25 979 777 23
4227 979 786 22 979 790 21 979 792 20 979 794 19 979 805 18 979 822 17
4228 979 839 15 979 839 16 979 840 14 979 844 13 979 845 12 979 870 9
4229 979 870 10 979 870 11 979 899 9 979 911 8 979 929 7}
4231 do_execsql_test 5.1.14.2 {
4232 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4234 dense_rank() OVER win
4236 WINDOW win AS ( ORDER BY c NULLS LAST, b NULLS LAST, a NULLS LAST
4237 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS )
4238 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4239 } {3830 89 89 4741 88 88 5640 84 84 5640 85 85 5640 86 86 5640 87 87
4240 6485 81 81 6485 82 82 6485 83 83 7324 80 80 8163 78 78 8163 79 79
4241 8968 73 73 8968 74 74 8968 75 75 8968 76 76 8968 77 77 9745 69 69
4242 9745 70 70 9745 71 71 9745 72 72 10504 65 65 10504 66 66
4243 10504 67 67 10504 68 68 11215 64 64 11920 63 63 12603 62 62
4244 13274 60 60 13274 61 61 13941 59 59 14608 55 55 14608 56 56
4245 14608 57 57 14608 58 58 15241 54 54 15870 53 53 16499 52 52
4246 17126 49 49 17126 50 50 17126 51 51 17733 44 44 17733 45 45
4247 17733 46 46 17733 47 47 17733 48 48 18176 42 42 18176 43 43
4248 18597 40 40 18597 41 41 18996 39 39 19395 37 37 19395 38 38
4249 19788 36 36 20181 35 35 20536 34 34 20891 30 30 20891 31 31
4250 20891 32 32 20891 33 33 21226 28 28 21226 29 29 21535 27 27
4251 21830 26 26 22087 22 22 22087 23 23 22087 24 24 22087 25 25
4252 22334 21 21 22573 17 17 22573 18 18 22573 19 19 22573 20 20
4253 22796 11 11 22796 12 12 22796 13 13 22796 14 14 22796 15 15
4254 22796 16 16 22929 10 10 23042 9 9 23155 1 1 23155 2 2 23155 3 3
4255 23155 4 4 23155 5 5 23155 6 6 23155 7 7 23155 8 8}
4257 do_execsql_test 5.2.1.1 {
4258 SELECT max(c) OVER win,
4262 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4263 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4264 } {963 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4265 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4266 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4267 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4268 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4269 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4270 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4271 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4272 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4273 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4274 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4275 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4276 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4277 979 102 82 979 102 82 979 102 82 979 102 82 979 102 83 979 102 83
4278 979 102 83 979 102 83 979 102 83 979 102 83 979 113 82}
4280 do_execsql_test 5.2.1.2 {
4281 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4283 dense_rank() OVER win
4285 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4286 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4287 } {22176 1 1 22192 1 1 22196 1 1 22226 1 1 22244 1 1 22256 1 1
4288 22310 1 1 22316 1 1 22316 1 1 22350 1 1 22378 1 1 22396 1 1
4289 22444 1 1 22450 1 1 22472 1 1 22484 1 1 22488 1 1 22488 1 1
4290 22522 1 1 22526 1 1 22526 1 1 22528 1 1 22548 1 1 22712 1 1
4291 22734 1 1 22756 1 1 22756 1 1 22762 1 1 22762 1 1 22800 1 1
4292 22800 1 1 22820 1 1 22846 1 1 22860 1 1 22898 1 1 22908 1 1
4293 22916 1 1 22932 1 1 23022 1 1 23042 1 1 23042 1 1 23155 1 1
4294 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4295 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4296 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4297 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4298 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4299 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4300 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4301 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1}
4303 do_execsql_test 5.2.2.1 {
4304 SELECT max(c) OVER win,
4308 WINDOW win AS ( ORDER BY a NULLS FIRST
4309 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4310 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4311 } {839 113 8 899 113 8 899 113 8 899 113 8 899 113 8 899 113 8
4312 899 113 8 899 113 8 899 113 15 899 113 15 899 113 15 899 113 15
4313 899 113 15 899 113 15 899 113 15 899 234 8 963 113 24 979 102 43
4314 979 102 43 979 102 43 979 102 43 979 102 43 979 102 43 979 102 43
4315 979 102 43 979 102 43 979 102 43 979 102 48 979 102 48 979 102 48
4316 979 102 48 979 102 48 979 102 55 979 102 55 979 102 55 979 102 55
4317 979 102 55 979 102 55 979 102 55 979 102 61 979 102 61 979 102 61
4318 979 102 61 979 102 61 979 102 61 979 102 74 979 102 74 979 102 74
4319 979 102 74 979 102 74 979 102 74 979 102 74 979 102 74 979 102 74
4320 979 102 74 979 102 74 979 102 74 979 102 74 979 102 82 979 102 82
4321 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4322 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
4323 979 113 24 979 113 24 979 113 24 979 113 24 979 113 24 979 113 24
4324 979 113 24 979 113 24 979 113 32 979 113 32 979 113 32 979 113 32
4325 979 113 32 979 113 32 979 113 32 979 113 32 979 113 43}
4327 do_execsql_test 5.2.2.2 {
4328 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4330 dense_rank() OVER win
4332 WINDOW win AS ( ORDER BY a NULLS FIRST
4333 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4334 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4335 } {2048 81 11 2108 81 11 2108 81 11 2690 81 11 2834 81 11 2947 81 11
4336 2947 81 11 2947 81 11 2947 81 11 4482 74 10 4616 74 10 4844 74 10
4337 4866 74 10 5287 74 10 5287 74 10 5287 74 10 7421 65 9 7437 65 9
4338 7717 65 9 8045 65 9 8267 65 9 8400 65 9 8400 65 9 8400 65 9
4339 8400 65 9 8735 57 8 9329 57 8 9664 57 8 9664 57 8 9664 57 8
4340 9664 57 8 9664 57 8 9664 57 8 9959 46 7 10331 46 7 10626 46 7
4341 10626 46 7 10626 46 7 10626 46 7 10626 46 7 10626 46 7 10626 46 7
4342 10626 46 7 10626 46 7 11368 41 6 11516 41 6 12032 41 6 12145 41 6
4343 12145 41 6 12990 34 5 13104 34 5 13949 34 5 13949 34 5 13949 34 5
4344 13949 34 5 13949 34 5 14556 28 4 14708 28 4 15315 28 4 15315 28 4
4345 15315 28 4 15315 28 4 18085 15 3 18091 15 3 18163 15 3 18397 15 3
4346 18403 15 3 18403 15 3 18549 15 3 18796 15 3 18796 15 3 18796 15 3
4347 18796 15 3 18796 15 3 18796 15 3 20194 7 2 20478 7 2 20796 7 2
4348 20866 7 2 20882 7 2 21105 7 2 21105 7 2 21105 7 2 22488 1 1
4349 22526 1 1 22756 1 1 22800 1 1 23155 1 1 23155 1 1}
4351 do_execsql_test 5.2.3.1 {
4352 SELECT max(c) OVER win,
4356 WINDOW win AS ( PARTITION BY coalesce(a, '')
4357 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4358 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4359 } {667 158 0 671 250 6 759 158 5 768 113 4 777 113 4 777 113 4
4360 777 113 4 777 252 4 792 247 12 805 250 6 805 250 6 805 250 6
4361 805 250 6 805 250 6 805 398 6 822 158 5 822 158 5 822 158 5
4362 822 158 5 822 346 5 839 113 8 840 247 12 840 247 12 840 247 12
4363 840 247 12 840 247 12 840 247 12 840 247 12 840 247 12 840 247 12
4364 840 247 12 840 247 12 840 393 12 845 224 6 870 102 10 870 158 0
4365 870 158 0 870 158 0 870 158 0 870 355 0 899 113 8 899 113 8
4366 899 113 8 899 113 8 899 113 8 899 113 8 899 113 8 899 234 8
4367 911 223 7 929 148 7 934 223 7 934 223 7 934 223 7 934 223 7
4368 934 223 7 934 223 7 934 239 7 938 102 10 938 102 10 938 102 10
4369 938 102 10 938 102 10 938 102 10 938 102 10 938 102 10 938 102 10
4370 938 148 7 938 148 7 938 148 7 938 148 7 938 148 7 938 148 7
4371 938 160 7 938 208 10 959 224 6 959 224 6 959 224 6 959 224 6
4372 959 224 6 959 238 6 963 133 8 979 133 8 979 133 8 979 133 8
4373 979 133 8 979 133 8 979 133 8 979 133 8 979 330 8}
4375 do_execsql_test 5.2.3.2 {
4376 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4378 dense_rank() OVER win
4380 WINDOW win AS ( PARTITION BY coalesce(a, '')
4381 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4382 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4383 } {295 1 1 335 1 1 607 1 1 667 1 1 742 1 1 759 1 1 845 1 1
4384 890 1 1 929 1 1 959 1 1 962 1 1 962 1 1 962 1 1 962 1 1
4385 962 1 1 962 1 1 962 1 1 962 1 1 962 1 1 1264 1 1 1264 1 1
4386 1264 1 1 1264 1 1 1264 1 1 1264 1 1 1366 1 1 1366 1 1 1366 1 1
4387 1366 1 1 1383 1 1 1398 1 1 1406 1 1 1421 1 1 1519 1 1 1519 1 1
4388 1535 1 1 1651 1 1 1669 1 1 1682 1 1 1695 1 1 1804 1 1 1804 1 1
4389 1804 1 1 1804 1 1 1804 1 1 1897 1 1 1919 1 1 2000 1 1 2048 1 1
4390 2050 1 1 2050 1 1 2070 1 1 2086 1 1 2108 1 1 2108 1 1 2134 1 1
4391 2150 1 1 2309 1 1 2309 1 1 2309 1 1 2340 1 1 2340 1 1 2340 1 1
4392 2430 1 1 2690 1 1 2758 1 1 2770 1 1 2776 1 1 2834 1 1 2848 1 1
4393 2947 1 1 2947 1 1 2947 1 1 2947 1 1 2980 1 1 3082 1 1 3088 1 1
4394 3088 1 1 3113 1 1 3113 1 1 3113 1 1 3113 1 1 3234 1 1 3481 1 1
4395 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1}
4397 do_execsql_test 5.2.4.1 {
4398 SELECT max(c) OVER win,
4402 WINDOW win AS ( ORDER BY a NULLS FIRST GROUPS 6 PRECEDING EXCLUDE CURRENT ROW )
4403 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4404 } {667 158 0 870 158 0 870 158 0 870 158 0 870 158 0 870 355 0
4405 911 158 7 934 158 7 934 158 7 934 158 7 934 158 7 934 158 7
4406 934 158 7 934 158 7 934 158 20 934 158 20 934 158 20 934 158 20
4407 934 158 20 934 158 20 934 158 20 934 158 20 934 158 20 934 158 20
4408 934 158 20 934 158 20 934 158 20 934 158 26 934 158 26 934 158 26
4409 934 158 26 934 158 26 934 158 26 934 158 33 959 102 49 959 102 49
4410 959 102 49 959 102 49 959 102 49 959 102 49 959 102 49 959 102 49
4411 959 102 49 959 102 49 959 102 57 959 102 57 959 102 57 959 102 57
4412 959 102 57 959 102 57 959 102 57 959 102 57 959 113 38 959 113 38
4413 959 113 38 959 113 38 959 113 49 959 158 33 959 158 33 959 158 33
4414 959 158 33 959 158 33 959 158 33 959 158 38 963 102 58 979 102 52
4415 979 102 52 979 102 52 979 102 52 979 102 52 979 102 52 979 102 52
4416 979 102 55 979 102 55 979 102 55 979 102 55 979 102 55 979 102 55
4417 979 102 55 979 102 55 979 102 55 979 102 58 979 102 58 979 102 58
4418 979 102 58 979 102 58 979 102 58 979 102 58 979 102 58}
4420 do_execsql_test 5.2.4.2 {
4421 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4423 dense_rank() OVER win
4425 WINDOW win AS ( ORDER BY a NULLS FIRST GROUPS 6 PRECEDING EXCLUDE CURRENT ROW )
4426 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4427 } {1383 1 1 1421 1 1 1651 1 1 1695 1 1 2050 1 1 2050 1 1 3448 7 2
4428 3732 7 2 4050 7 2 4120 7 2 4136 7 2 4359 7 2 4359 7 2 4359 7 2
4429 7129 15 3 7135 15 3 7207 15 3 7441 15 3 7447 15 3 7447 15 3
4430 7593 15 3 7840 15 3 7840 15 3 7840 15 3 7840 15 3 7840 15 3
4431 7840 15 3 8447 28 4 8599 28 4 9206 28 4 9206 28 4 9206 28 4
4432 9206 28 4 10051 34 5 10165 34 5 11010 34 5 11010 34 5 11010 34 5
4433 11010 34 5 11010 34 5 11563 74 10 11697 74 10 11752 41 6
4434 11776 57 8 11900 41 6 11925 74 10 11947 74 10 12368 74 10
4435 12368 74 10 12368 74 10 12370 57 8 12416 41 6 12529 41 6
4436 12529 41 6 12530 65 9 12546 65 9 12705 57 8 12705 57 8 12705 57 8
4437 12705 57 8 12705 57 8 12705 57 8 12824 46 7 12826 65 9
4438 13050 81 11 13110 81 11 13110 81 11 13154 65 9 13196 46 7
4439 13376 65 9 13491 46 7 13491 46 7 13491 46 7 13491 46 7 13491 46 7
4440 13491 46 7 13491 46 7 13491 46 7 13491 46 7 13509 65 9 13509 65 9
4441 13509 65 9 13509 65 9 13692 81 11 13836 81 11 13949 81 11
4442 13949 81 11 13949 81 11 13949 81 11}
4444 do_execsql_test 5.2.5.1 {
4445 SELECT max(c) OVER win,
4449 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE CURRENT ROW )
4450 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4451 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4452 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4453 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 113 113 1
4454 113 113 1 158 158 1 160 158 1 160 158 2 223 223 1 224 224 1
4455 238 234 2 239 234 2 239 238 2 252 250 2 256 252 2 257 247 4
4456 257 247 4 257 250 3 335 330 2 336 330 2 336 335 2 355 354 1
4457 355 354 2 355 355 1 399 393 3 399 393 3 399 393 3 399 393 3
4458 399 393 4 480 480 1 480 480 1 572 572 1 574 574 1 618 618 1
4459 618 618 1 633 629 2 634 627 3 634 627 3 634 627 4 634 629 3
4460 667 667 1 670 667 2 671 667 2 671 667 2 671 667 3 711 711 1
4461 711 711 1 716 705 2 726 726 1 730 730 1 762 762 1 768 759 3
4462 768 762 2 768 762 2 792 790 2 792 790 2 794 786 3 794 786 3
4463 844 839 4 845 839 4 845 839 4 845 839 4 845 839 4 870 870 1
4464 870 870 1 870 870 2 934 934 1 938 929 3 938 934 2 938 934 2
4465 959 959 1 963 963 1}
4467 do_execsql_test 5.2.5.2 {
4468 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4470 dense_rank() OVER win
4472 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE CURRENT ROW )
4473 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4474 } {{} 1 1 {} 4 3 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 10 8
4475 {} 14 12 {} 15 13 {} 19 17 {} 20 18 {} 21 19 {} 23 21 {} 25 23
4476 {} 34 29 {} 35 30 {} 36 31 {} 37 32 {} 38 33 {} 38 33 {} 40 34
4477 {} 41 35 {} 42 36 {} 43 37 {} 43 37 {} 50 42 {} 56 47 {} 60 51
4478 {} 61 52 {} 62 53 {} 64 55 {} 64 55 {} 66 56 {} 67 57 {} 68 58
4479 {} 69 59 {} 70 60 {} 71 61 {} 72 62 {} 78 67 {} 78 67 {} 78 67
4480 {} 81 68 {} 82 69 {} 83 70 {} 85 72 {} 85 72 {} 89 75 113 2 2
4481 113 2 2 223 11 9 239 12 10 239 13 11 257 18 16 335 22 20
4482 335 24 22 355 27 25 355 27 25 504 16 14 504 17 15 705 58 49
4483 710 26 24 711 57 48 711 59 50 759 63 54 929 84 71 959 88 74
4484 963 87 73 1185 32 28 1185 32 28 1191 29 26 1191 29 26 1334 51 43
4485 1334 55 46 1338 52 44 1338 52 44 1584 31 27 1678 77 66 1684 73 63
4486 1684 73 63 1885 48 40 1889 46 39 1889 46 39 1891 45 38 1891 49 41
4487 2005 54 45 2523 75 64 2523 76 65}
4489 do_execsql_test 5.2.6.1 {
4490 SELECT max(c) OVER win,
4494 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW )
4495 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4496 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4497 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4498 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4499 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4500 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4501 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4502 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4503 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4504 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 113 113 1
4505 113 113 1 158 158 0 158 158 1 355 355 0 355 355 1 393 393 1
4506 393 393 1 399 399 0 399 399 1 480 480 1 480 480 1 618 618 1
4507 618 618 1 629 629 0 629 629 1 667 667 0 667 667 1 768 768 1
4508 768 768 1 839 839 1 839 839 1 870 870 1 870 870 1 870 870 2
4509 938 938 1 938 938 1}
4511 do_execsql_test 5.2.6.2 {
4512 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4514 dense_rank() OVER win
4516 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW )
4517 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4518 } {{} 1 1 {} 4 3 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 10 8
4519 {} 11 9 {} 12 10 {} 13 11 {} 14 12 {} 15 13 {} 16 14 {} 17 15
4520 {} 18 16 {} 19 17 {} 20 18 {} 21 19 {} 22 20 {} 23 21 {} 24 22
4521 {} 25 23 {} 26 24 {} 31 27 {} 34 29 {} 35 30 {} 36 31 {} 37 32
4522 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 42 36 {} 43 37 {} 43 37
4523 {} 45 38 {} 48 40 {} 49 41 {} 50 42 {} 51 43 {} 54 45 {} 55 46
4524 {} 56 47 {} 57 48 {} 58 49 {} 59 50 {} 60 51 {} 61 52 {} 62 53
4525 {} 63 54 {} 64 55 {} 64 55 {} 66 56 {} 67 57 {} 68 58 {} 69 59
4526 {} 70 60 {} 71 61 {} 72 62 {} 75 64 {} 76 65 {} 77 66 {} 78 67
4527 {} 78 67 {} 78 67 {} 81 68 {} 82 69 {} 83 70 {} 84 71 {} 85 72
4528 {} 85 72 {} 87 73 {} 88 74 {} 89 75 113 2 2 113 2 2 355 27 25
4529 355 27 25 393 29 26 393 29 26 399 32 28 399 32 28 629 46 39
4530 629 46 39 667 52 44 667 52 44 839 73 63 839 73 63}
4532 do_execsql_test 5.2.7.1 {
4533 SELECT max(c) OVER win,
4537 WINDOW win AS ( ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
4538 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4539 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4540 } {963 929 6 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4541 979 102 83 979 113 80 979 113 81 979 113 82 979 133 79 979 148 78
4542 979 158 76 979 158 77 979 160 76 979 208 75 979 223 74 979 224 73
4543 979 234 72 979 238 71 979 239 70 979 247 69 979 250 68 979 252 67
4544 979 256 66 979 257 65 979 295 64 979 309 64 979 330 62 979 335 61
4545 979 336 60 979 346 59 979 354 59 979 355 57 979 355 57 979 393 55
4546 979 393 56 979 398 54 979 399 53 979 399 53 979 412 52 979 421 51
4547 979 430 50 979 443 49 979 480 47 979 480 48 979 572 47 979 574 45
4548 979 607 44 979 618 42 979 618 43 979 627 41 979 629 40 979 629 41
4549 979 633 39 979 634 38 979 652 37 979 660 36 979 667 35 979 667 35
4550 979 670 34 979 671 33 979 683 32 979 705 31 979 711 30 979 716 29
4551 979 726 28 979 730 27 979 759 26 979 762 25 979 768 23 979 768 24
4552 979 777 22 979 786 21 979 790 20 979 792 19 979 794 18 979 805 17
4553 979 822 17 979 839 14 979 839 15 979 840 13 979 844 12 979 845 11
4554 979 870 9 979 870 10 979 870 10 979 899 8 979 911 7}
4556 do_execsql_test 5.2.7.2 {
4557 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4559 dense_rank() OVER win
4561 WINDOW win AS ( ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
4562 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4563 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4564 } {2851 89 89 3778 88 88 4681 87 87 5556 83 83 5574 82 82 5586 81 81
4565 5640 84 84 5640 85 85 5640 86 86 7324 80 80 8123 77 77 8129 73 73
4566 8129 74 74 8163 78 78 8163 79 79 8940 71 71 8968 75 75 8968 76 76
4567 9727 66 66 9745 69 69 9745 70 70 9745 72 72 10504 65 65
4568 10504 67 67 10504 68 68 11215 64 64 11844 62 62 11920 63 63
4569 13274 60 60 13274 61 61 13897 58 58 13903 57 57 13925 56 56
4570 13937 55 55 13941 59 59 15203 53 53 15241 54 54 15832 52 52
4571 17100 48 48 17104 46 46 17104 47 47 17106 45 45 17126 49 49
4572 17126 50 50 17126 51 51 17569 42 42 17733 44 44 18176 43 43
4573 18597 40 40 18597 41 41 18952 37 37 18996 39 39 19395 38 38
4574 19760 35 35 19788 36 36 20492 32 32 20492 33 33 20498 30 30
4575 20536 34 34 20833 29 29 20871 28 28 20891 31 31 21180 27 27
4576 21752 23 23 21830 26 26 22025 21 21 22087 22 22 22087 24 24
4577 22087 25 25 22278 20 20 22316 19 19 22549 15 15 22557 14 14
4578 22573 17 17 22573 18 18 22706 10 10 22796 11 11 22796 12 12
4579 22796 13 13 22796 16 16 23022 4 4 23042 2 2 23042 3 3 23042 9 9
4580 23155 1 1 23155 5 5 23155 6 6 23155 7 7 23155 8 8}
4582 do_execsql_test 5.2.8.1 {
4583 SELECT max(c) OVER win,
4587 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4588 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4589 } {963 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4590 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4591 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4592 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4593 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4594 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4595 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4596 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4597 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4598 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4599 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4600 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4601 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4602 979 102 82 979 102 82 979 102 82 979 102 82 979 102 83 979 102 83
4603 979 102 83 979 102 83 979 102 83 979 102 83 979 113 82}
4605 do_execsql_test 5.2.8.2 {
4606 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4608 dense_rank() OVER win
4610 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4611 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4612 } {22176 1 1 22192 1 1 22196 1 1 22226 1 1 22244 1 1 22256 1 1
4613 22310 1 1 22316 1 1 22316 1 1 22350 1 1 22378 1 1 22396 1 1
4614 22444 1 1 22450 1 1 22472 1 1 22484 1 1 22488 1 1 22488 1 1
4615 22522 1 1 22526 1 1 22526 1 1 22528 1 1 22548 1 1 22712 1 1
4616 22734 1 1 22756 1 1 22756 1 1 22762 1 1 22762 1 1 22800 1 1
4617 22800 1 1 22820 1 1 22846 1 1 22860 1 1 22898 1 1 22908 1 1
4618 22916 1 1 22932 1 1 23022 1 1 23042 1 1 23042 1 1 23155 1 1
4619 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4620 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4621 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4622 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4623 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4624 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4625 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1
4626 23155 1 1 23155 1 1 23155 1 1 23155 1 1 23155 1 1}
4628 do_execsql_test 5.2.9.1 {
4629 SELECT max(c) OVER win,
4633 WINDOW win AS ( ORDER BY a NULLS LAST
4634 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4635 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4636 } {667 158 0 870 113 8 870 158 0 870 158 0 870 158 0 870 158 0
4637 870 355 0 899 113 8 899 113 8 899 113 8 899 113 8 899 113 8
4638 899 113 8 899 113 8 899 113 15 899 113 15 899 113 15 899 113 15
4639 899 113 15 899 113 15 899 113 15 899 158 8 963 113 24 979 102 43
4640 979 102 43 979 102 43 979 102 43 979 102 43 979 102 43 979 102 43
4641 979 102 43 979 102 43 979 102 43 979 102 48 979 102 48 979 102 48
4642 979 102 48 979 102 48 979 102 55 979 102 55 979 102 55 979 102 55
4643 979 102 55 979 102 55 979 102 55 979 102 61 979 102 61 979 102 61
4644 979 102 61 979 102 61 979 102 61 979 102 74 979 102 74 979 102 74
4645 979 102 74 979 102 74 979 102 74 979 102 74 979 102 74 979 102 74
4646 979 102 74 979 102 74 979 102 74 979 102 74 979 102 82 979 102 82
4647 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4648 979 113 24 979 113 24 979 113 24 979 113 24 979 113 24 979 113 24
4649 979 113 24 979 113 24 979 113 32 979 113 32 979 113 32 979 113 32
4650 979 113 32 979 113 32 979 113 32 979 113 32 979 113 43}
4652 do_execsql_test 5.2.9.2 {
4653 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4655 dense_rank() OVER win
4657 WINDOW win AS ( ORDER BY a NULLS LAST
4658 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4659 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4660 } {1383 84 11 1421 84 11 1651 84 11 1695 84 11 2050 84 11 2050 84 11
4661 4098 75 10 4158 75 10 4158 75 10 4740 75 10 4884 75 10 4997 75 10
4662 4997 75 10 4997 75 10 4997 75 10 6532 68 9 6666 68 9 6894 68 9
4663 6916 68 9 7337 68 9 7337 68 9 7337 68 9 9471 59 8 9487 59 8
4664 9767 59 8 10095 59 8 10317 59 8 10450 59 8 10450 59 8 10450 59 8
4665 10450 59 8 10785 51 7 11379 51 7 11714 51 7 11714 51 7 11714 51 7
4666 11714 51 7 11714 51 7 11714 51 7 12009 40 6 12381 40 6 12676 40 6
4667 12676 40 6 12676 40 6 12676 40 6 12676 40 6 12676 40 6 12676 40 6
4668 12676 40 6 12676 40 6 13418 35 5 13566 35 5 14082 35 5 14195 35 5
4669 14195 35 5 15040 28 4 15154 28 4 15999 28 4 15999 28 4 15999 28 4
4670 15999 28 4 15999 28 4 16606 22 3 16758 22 3 17365 22 3 17365 22 3
4671 17365 22 3 17365 22 3 20135 9 2 20141 9 2 20213 9 2 20447 9 2
4672 20453 9 2 20453 9 2 20599 9 2 20846 9 2 20846 9 2 20846 9 2
4673 20846 9 2 20846 9 2 20846 9 2 22244 1 1 22528 1 1 22846 1 1
4674 22916 1 1 22932 1 1 23155 1 1 23155 1 1 23155 1 1}
4676 do_execsql_test 5.2.10.1 {
4677 SELECT max(c) OVER win,
4681 WINDOW win AS ( PARTITION BY coalesce(a, '')
4682 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4683 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4684 } {667 158 0 671 250 6 759 158 5 768 113 4 777 113 4 777 113 4
4685 777 113 4 777 252 4 792 247 12 805 250 6 805 250 6 805 250 6
4686 805 250 6 805 250 6 805 398 6 822 158 5 822 158 5 822 158 5
4687 822 158 5 822 346 5 839 113 8 840 247 12 840 247 12 840 247 12
4688 840 247 12 840 247 12 840 247 12 840 247 12 840 247 12 840 247 12
4689 840 247 12 840 247 12 840 393 12 845 224 6 870 102 10 870 158 0
4690 870 158 0 870 158 0 870 158 0 870 355 0 899 113 8 899 113 8
4691 899 113 8 899 113 8 899 113 8 899 113 8 899 113 8 899 234 8
4692 911 223 7 929 148 7 934 223 7 934 223 7 934 223 7 934 223 7
4693 934 223 7 934 223 7 934 239 7 938 102 10 938 102 10 938 102 10
4694 938 102 10 938 102 10 938 102 10 938 102 10 938 102 10 938 102 10
4695 938 148 7 938 148 7 938 148 7 938 148 7 938 148 7 938 148 7
4696 938 160 7 938 208 10 959 224 6 959 224 6 959 224 6 959 224 6
4697 959 224 6 959 238 6 963 133 8 979 133 8 979 133 8 979 133 8
4698 979 133 8 979 133 8 979 133 8 979 133 8 979 330 8}
4700 do_execsql_test 5.2.10.2 {
4701 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4703 dense_rank() OVER win
4705 WINDOW win AS ( PARTITION BY coalesce(a, '')
4706 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4707 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4708 } {295 1 1 335 1 1 607 1 1 667 1 1 742 1 1 759 1 1 845 1 1
4709 890 1 1 929 1 1 959 1 1 962 1 1 962 1 1 962 1 1 962 1 1
4710 962 1 1 962 1 1 962 1 1 962 1 1 962 1 1 1264 1 1 1264 1 1
4711 1264 1 1 1264 1 1 1264 1 1 1264 1 1 1366 1 1 1366 1 1 1366 1 1
4712 1366 1 1 1383 1 1 1398 1 1 1406 1 1 1421 1 1 1519 1 1 1519 1 1
4713 1535 1 1 1651 1 1 1669 1 1 1682 1 1 1695 1 1 1804 1 1 1804 1 1
4714 1804 1 1 1804 1 1 1804 1 1 1897 1 1 1919 1 1 2000 1 1 2048 1 1
4715 2050 1 1 2050 1 1 2070 1 1 2086 1 1 2108 1 1 2108 1 1 2134 1 1
4716 2150 1 1 2309 1 1 2309 1 1 2309 1 1 2340 1 1 2340 1 1 2340 1 1
4717 2430 1 1 2690 1 1 2758 1 1 2770 1 1 2776 1 1 2834 1 1 2848 1 1
4718 2947 1 1 2947 1 1 2947 1 1 2947 1 1 2980 1 1 3082 1 1 3088 1 1
4719 3088 1 1 3113 1 1 3113 1 1 3113 1 1 3113 1 1 3234 1 1 3481 1 1
4720 3481 1 1 3481 1 1 3481 1 1 3481 1 1 3481 1 1}
4722 do_execsql_test 5.2.11.1 {
4723 SELECT max(c) OVER win,
4727 WINDOW win AS ( ORDER BY a NULLS LAST GROUPS 6 PRECEDING EXCLUDE CURRENT ROW )
4728 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4729 } {911 223 7 934 158 26 934 158 26 934 158 26 934 158 26 934 158 26
4730 934 158 33 934 223 7 934 223 7 934 223 7 934 223 7 934 223 7
4731 934 223 7 934 223 20 934 223 20 934 223 20 934 223 20 934 223 20
4732 934 223 20 934 223 20 934 223 20 934 223 20 934 223 20 934 223 20
4733 934 223 20 934 223 20 934 223 26 934 239 7 959 102 49 959 102 49
4734 959 102 49 959 102 49 959 102 49 959 102 49 959 102 49 959 102 49
4735 959 102 49 959 102 49 959 102 57 959 102 57 959 102 57 959 102 57
4736 959 102 57 959 102 57 959 102 57 959 102 57 959 113 38 959 113 38
4737 959 113 38 959 113 38 959 113 49 959 158 33 959 158 33 959 158 33
4738 959 158 33 959 158 33 959 158 33 959 158 38 963 102 58 979 102 49
4739 979 102 49 979 102 49 979 102 49 979 102 49 979 102 49 979 102 52
4740 979 102 52 979 102 52 979 102 52 979 102 52 979 102 52 979 102 52
4741 979 102 55 979 102 55 979 102 55 979 102 55 979 102 55 979 102 55
4742 979 102 55 979 102 55 979 102 55 979 102 58 979 102 58 979 102 58
4743 979 102 58 979 102 58 979 102 58 979 102 58 979 102 58}
4745 do_execsql_test 5.2.11.2 {
4746 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4748 dense_rank() OVER win
4750 WINDOW win AS ( ORDER BY a NULLS LAST GROUPS 6 PRECEDING EXCLUDE CURRENT ROW )
4751 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4752 } {1398 1 1 1682 1 1 2000 1 1 2070 1 1 2086 1 1 2309 1 1 2309 1 1
4753 2309 1 1 5079 9 2 5085 9 2 5157 9 2 5391 9 2 5397 9 2 5397 9 2
4754 5543 9 2 5790 9 2 5790 9 2 5790 9 2 5790 9 2 5790 9 2 5790 9 2
4755 6397 22 3 6549 22 3 7156 22 3 7156 22 3 7156 22 3 7156 22 3
4756 8001 28 4 8115 28 4 8960 28 4 8960 28 4 8960 28 4 8960 28 4
4757 8960 28 4 9702 35 5 9850 35 5 10366 35 5 10479 35 5 10479 35 5
4758 10774 40 6 11146 40 6 11441 40 6 11441 40 6 11441 40 6 11441 40 6
4759 11441 40 6 11441 40 6 11441 40 6 11441 40 6 11441 40 6 11563 68 9
4760 11697 68 9 11776 51 7 11925 68 9 11947 68 9 12368 68 9 12368 68 9
4761 12368 68 9 12370 51 7 12530 59 8 12546 59 8 12705 51 7 12705 51 7
4762 12705 51 7 12705 51 7 12705 51 7 12705 51 7 12826 59 8
4763 13050 75 10 13110 75 10 13110 75 10 13154 59 8 13376 59 8
4764 13509 59 8 13509 59 8 13509 59 8 13509 59 8 13528 84 11
4765 13566 84 11 13692 75 10 13796 84 11 13836 75 10 13840 84 11
4766 13949 75 10 13949 75 10 13949 75 10 13949 75 10 14195 84 11
4769 do_execsql_test 5.2.12.1 {
4770 SELECT max(c) OVER win,
4774 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE CURRENT ROW )
4775 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4776 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4777 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4778 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 113 113 1
4779 113 113 1 158 158 1 160 158 1 160 158 2 223 223 1 224 224 1
4780 238 234 2 239 234 2 239 238 2 252 250 2 256 252 2 257 247 4
4781 257 247 4 257 250 3 335 330 2 336 330 2 336 335 2 355 354 1
4782 355 354 2 355 355 1 399 393 3 399 393 3 399 393 3 399 393 3
4783 399 393 4 480 480 1 480 480 1 572 572 1 574 574 1 618 618 1
4784 618 618 1 633 629 2 634 627 3 634 627 3 634 627 4 634 629 3
4785 667 667 1 670 667 2 671 667 2 671 667 2 671 667 3 711 711 1
4786 711 711 1 716 705 2 726 726 1 730 730 1 762 762 1 768 759 3
4787 768 762 2 768 762 2 792 790 2 792 790 2 794 786 3 794 786 3
4788 844 839 4 845 839 4 845 839 4 845 839 4 845 839 4 870 870 1
4789 870 870 1 870 870 2 934 934 1 938 929 3 938 934 2 938 934 2
4790 959 959 1 963 963 1}
4792 do_execsql_test 5.2.12.2 {
4793 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4795 dense_rank() OVER win
4797 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE CURRENT ROW )
4798 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4799 } {{} 1 1 {} 4 3 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 10 8
4800 {} 14 12 {} 15 13 {} 19 17 {} 20 18 {} 21 19 {} 23 21 {} 25 23
4801 {} 34 29 {} 35 30 {} 36 31 {} 37 32 {} 38 33 {} 38 33 {} 40 34
4802 {} 41 35 {} 42 36 {} 43 37 {} 43 37 {} 50 42 {} 56 47 {} 60 51
4803 {} 61 52 {} 62 53 {} 64 55 {} 64 55 {} 66 56 {} 67 57 {} 68 58
4804 {} 69 59 {} 70 60 {} 71 61 {} 72 62 {} 78 67 {} 78 67 {} 78 67
4805 {} 81 68 {} 82 69 {} 83 70 {} 85 72 {} 85 72 {} 89 75 113 2 2
4806 113 2 2 223 11 9 239 12 10 239 13 11 257 18 16 335 22 20
4807 335 24 22 355 27 25 355 27 25 504 16 14 504 17 15 705 58 49
4808 710 26 24 711 57 48 711 59 50 759 63 54 929 84 71 959 88 74
4809 963 87 73 1185 32 28 1185 32 28 1191 29 26 1191 29 26 1334 51 43
4810 1334 55 46 1338 52 44 1338 52 44 1584 31 27 1678 77 66 1684 73 63
4811 1684 73 63 1885 48 40 1889 46 39 1889 46 39 1891 45 38 1891 49 41
4812 2005 54 45 2523 75 64 2523 76 65}
4814 do_execsql_test 5.2.13.1 {
4815 SELECT max(c) OVER win,
4819 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW )
4820 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4821 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4822 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4823 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4824 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4825 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4826 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4827 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4828 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4829 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 113 113 1
4830 113 113 1 158 158 0 158 158 1 355 355 0 355 355 1 393 393 1
4831 393 393 1 399 399 0 399 399 1 480 480 1 480 480 1 618 618 1
4832 618 618 1 629 629 0 629 629 1 667 667 0 667 667 1 768 768 1
4833 768 768 1 839 839 1 839 839 1 870 870 1 870 870 1 870 870 2
4834 938 938 1 938 938 1}
4836 do_execsql_test 5.2.13.2 {
4837 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4839 dense_rank() OVER win
4841 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE CURRENT ROW )
4842 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4843 } {{} 1 1 {} 4 3 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 10 8
4844 {} 11 9 {} 12 10 {} 13 11 {} 14 12 {} 15 13 {} 16 14 {} 17 15
4845 {} 18 16 {} 19 17 {} 20 18 {} 21 19 {} 22 20 {} 23 21 {} 24 22
4846 {} 25 23 {} 26 24 {} 31 27 {} 34 29 {} 35 30 {} 36 31 {} 37 32
4847 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 42 36 {} 43 37 {} 43 37
4848 {} 45 38 {} 48 40 {} 49 41 {} 50 42 {} 51 43 {} 54 45 {} 55 46
4849 {} 56 47 {} 57 48 {} 58 49 {} 59 50 {} 60 51 {} 61 52 {} 62 53
4850 {} 63 54 {} 64 55 {} 64 55 {} 66 56 {} 67 57 {} 68 58 {} 69 59
4851 {} 70 60 {} 71 61 {} 72 62 {} 75 64 {} 76 65 {} 77 66 {} 78 67
4852 {} 78 67 {} 78 67 {} 81 68 {} 82 69 {} 83 70 {} 84 71 {} 85 72
4853 {} 85 72 {} 87 73 {} 88 74 {} 89 75 113 2 2 113 2 2 355 27 25
4854 355 27 25 393 29 26 393 29 26 399 32 28 399 32 28 629 46 39
4855 629 46 39 667 52 44 667 52 44 839 73 63 839 73 63}
4857 do_execsql_test 5.2.14.1 {
4858 SELECT max(c) OVER win,
4862 WINDOW win AS ( ORDER BY c NULLS LAST, b NULLS LAST, a NULLS LAST
4863 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4864 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4865 } {963 929 6 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
4866 979 102 83 979 113 80 979 113 81 979 113 82 979 133 79 979 148 78
4867 979 158 76 979 158 77 979 160 76 979 208 75 979 223 74 979 224 73
4868 979 234 72 979 238 71 979 239 70 979 247 69 979 250 68 979 252 67
4869 979 256 66 979 257 65 979 295 64 979 309 63 979 330 63 979 335 61
4870 979 336 60 979 346 59 979 354 58 979 355 56 979 355 58 979 393 55
4871 979 393 56 979 398 54 979 399 52 979 399 53 979 412 52 979 421 51
4872 979 430 50 979 443 49 979 480 47 979 480 48 979 572 46 979 574 46
4873 979 607 44 979 618 42 979 618 43 979 627 41 979 629 40 979 629 40
4874 979 633 39 979 634 38 979 652 37 979 660 36 979 667 34 979 667 35
4875 979 670 34 979 671 33 979 683 32 979 705 31 979 711 30 979 716 29
4876 979 726 28 979 730 27 979 759 26 979 762 25 979 768 23 979 768 24
4877 979 777 22 979 786 21 979 790 20 979 792 19 979 794 18 979 805 17
4878 979 822 16 979 839 15 979 839 15 979 840 13 979 844 12 979 845 11
4879 979 870 8 979 870 9 979 870 10 979 899 8 979 911 7}
4881 do_execsql_test 5.2.14.2 {
4882 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4884 dense_rank() OVER win
4886 WINDOW win AS ( ORDER BY c NULLS LAST, b NULLS LAST, a NULLS LAST
4887 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE CURRENT ROW )
4888 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4889 } {2851 89 89 3778 88 88 4681 87 87 5556 83 83 5574 82 82 5586 81 81
4890 5640 84 84 5640 85 85 5640 86 86 7324 80 80 8123 77 77 8129 73 73
4891 8129 74 74 8163 78 78 8163 79 79 8940 71 71 8968 75 75 8968 76 76
4892 9727 66 66 9745 69 69 9745 70 70 9745 72 72 10504 65 65
4893 10504 67 67 10504 68 68 11215 64 64 11844 62 62 11920 63 63
4894 13274 60 60 13274 61 61 13897 58 58 13903 57 57 13925 56 56
4895 13937 55 55 13941 59 59 15203 53 53 15241 54 54 15832 52 52
4896 17100 48 48 17104 46 46 17104 47 47 17106 45 45 17126 49 49
4897 17126 50 50 17126 51 51 17569 42 42 17733 44 44 18176 43 43
4898 18597 40 40 18597 41 41 18952 37 37 18996 39 39 19395 38 38
4899 19760 35 35 19788 36 36 20492 32 32 20492 33 33 20498 30 30
4900 20536 34 34 20833 29 29 20871 28 28 20891 31 31 21180 27 27
4901 21752 23 23 21830 26 26 22025 21 21 22087 22 22 22087 24 24
4902 22087 25 25 22278 20 20 22316 19 19 22549 15 15 22557 14 14
4903 22573 17 17 22573 18 18 22706 10 10 22796 11 11 22796 12 12
4904 22796 13 13 22796 16 16 23022 4 4 23042 2 2 23042 3 3 23042 9 9
4905 23155 1 1 23155 5 5 23155 6 6 23155 7 7 23155 8 8}
4907 do_execsql_test 5.3.1.1 {
4908 SELECT max(c) OVER win,
4912 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
4913 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4914 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4915 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4916 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4917 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4918 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4919 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4920 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4921 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4922 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4923 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4924 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4925 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4926 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0}
4928 do_execsql_test 5.3.1.2 {
4929 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4931 dense_rank() OVER win
4933 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
4934 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4935 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4936 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4937 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4938 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4939 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4940 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4941 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4942 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4943 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4944 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4945 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
4948 do_execsql_test 5.3.2.1 {
4949 SELECT max(c) OVER win,
4953 WINDOW win AS ( ORDER BY a NULLS FIRST
4954 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
4955 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4956 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
4957 {} {} 0 {} {} 0 899 113 9 899 113 9 899 113 9 899 113 9
4958 899 113 9 899 113 9 899 113 9 899 113 16 899 113 16 899 113 16
4959 899 113 16 899 113 16 899 113 16 899 113 16 899 113 16 899 113 16
4960 979 102 44 979 102 44 979 102 44 979 102 44 979 102 44 979 102 49
4961 979 102 49 979 102 49 979 102 49 979 102 49 979 102 49 979 102 49
4962 979 102 56 979 102 56 979 102 56 979 102 56 979 102 56 979 102 56
4963 979 102 62 979 102 62 979 102 62 979 102 62 979 102 62 979 102 62
4964 979 102 62 979 102 62 979 102 62 979 102 62 979 102 62 979 102 62
4965 979 102 62 979 102 75 979 102 75 979 102 75 979 102 75 979 102 75
4966 979 102 75 979 102 75 979 102 75 979 102 83 979 102 83 979 102 83
4967 979 102 83 979 102 83 979 102 83 979 113 25 979 113 25 979 113 25
4968 979 113 25 979 113 25 979 113 25 979 113 25 979 113 25 979 113 33
4969 979 113 33 979 113 33 979 113 33 979 113 33 979 113 33 979 113 33
4970 979 113 33 979 113 33 979 113 33 979 113 33}
4972 do_execsql_test 5.3.2.2 {
4973 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
4975 dense_rank() OVER win
4977 WINDOW win AS ( ORDER BY a NULLS FIRST
4978 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
4979 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
4980 } {{} 81 11 {} 81 11 {} 81 11 {} 81 11 {} 81 11 {} 81 11 {} 81 11
4981 {} 81 11 {} 81 11 2947 74 10 2947 74 10 2947 74 10 2947 74 10
4982 2947 74 10 2947 74 10 2947 74 10 5287 65 9 5287 65 9 5287 65 9
4983 5287 65 9 5287 65 9 5287 65 9 5287 65 9 5287 65 9 5287 65 9
4984 8400 57 8 8400 57 8 8400 57 8 8400 57 8 8400 57 8 8400 57 8
4985 8400 57 8 8400 57 8 9664 46 7 9664 46 7 9664 46 7 9664 46 7
4986 9664 46 7 9664 46 7 9664 46 7 9664 46 7 9664 46 7 9664 46 7
4987 9664 46 7 10626 41 6 10626 41 6 10626 41 6 10626 41 6 10626 41 6
4988 12145 34 5 12145 34 5 12145 34 5 12145 34 5 12145 34 5 12145 34 5
4989 12145 34 5 13949 28 4 13949 28 4 13949 28 4 13949 28 4 13949 28 4
4990 13949 28 4 15315 15 3 15315 15 3 15315 15 3 15315 15 3 15315 15 3
4991 15315 15 3 15315 15 3 15315 15 3 15315 15 3 15315 15 3 15315 15 3
4992 15315 15 3 15315 15 3 18796 7 2 18796 7 2 18796 7 2 18796 7 2
4993 18796 7 2 18796 7 2 18796 7 2 18796 7 2 21105 1 1 21105 1 1
4994 21105 1 1 21105 1 1 21105 1 1 21105 1 1}
4996 do_execsql_test 5.3.3.1 {
4997 SELECT max(c) OVER win,
5001 WINDOW win AS ( PARTITION BY coalesce(a, '')
5002 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5003 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5004 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5005 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5006 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5007 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5008 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5009 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5010 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5011 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5012 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5013 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5014 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5015 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5016 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0}
5018 do_execsql_test 5.3.3.2 {
5019 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5021 dense_rank() OVER win
5023 WINDOW win AS ( PARTITION BY coalesce(a, '')
5024 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5025 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5026 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5027 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5028 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5029 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5030 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5031 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5032 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5033 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5034 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5035 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5036 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5039 do_execsql_test 5.3.4.1 {
5040 SELECT max(c) OVER win,
5044 WINDOW win AS ( ORDER BY a NULLS FIRST GROUPS 6 PRECEDING EXCLUDE GROUP )
5045 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5046 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 870 158 0
5047 870 158 0 870 158 0 870 158 0 870 158 0 870 158 0 870 158 0
5048 870 158 0 934 158 8 934 158 8 934 158 8 934 158 8 934 158 8
5049 934 158 8 934 158 8 934 158 8 934 158 8 934 158 8 934 158 8
5050 934 158 8 934 158 8 934 158 21 934 158 21 934 158 21 934 158 21
5051 934 158 21 934 158 21 934 158 27 934 158 27 934 158 27 934 158 27
5052 934 158 27 934 158 27 934 158 27 959 102 50 959 102 50 959 102 50
5053 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50
5054 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50
5055 959 102 50 959 102 50 959 113 39 959 113 39 959 113 39 959 113 39
5056 959 113 39 959 113 39 959 113 39 959 113 39 959 113 39 959 113 39
5057 959 113 39 959 158 34 959 158 34 959 158 34 959 158 34 959 158 34
5058 979 102 46 979 102 46 979 102 46 979 102 46 979 102 46 979 102 46
5059 979 102 46 979 102 47 979 102 47 979 102 47 979 102 47 979 102 47
5060 979 102 47 979 102 47 979 102 47 979 102 47}
5062 do_execsql_test 5.3.4.2 {
5063 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5065 dense_rank() OVER win
5067 WINDOW win AS ( ORDER BY a NULLS FIRST GROUPS 6 PRECEDING EXCLUDE GROUP )
5068 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5069 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 2050 7 2 2050 7 2
5070 2050 7 2 2050 7 2 2050 7 2 2050 7 2 2050 7 2 2050 7 2 4359 15 3
5071 4359 15 3 4359 15 3 4359 15 3 4359 15 3 4359 15 3 4359 15 3
5072 4359 15 3 4359 15 3 4359 15 3 4359 15 3 4359 15 3 4359 15 3
5073 7840 28 4 7840 28 4 7840 28 4 7840 28 4 7840 28 4 7840 28 4
5074 9206 34 5 9206 34 5 9206 34 5 9206 34 5 9206 34 5 9206 34 5
5075 9206 34 5 10028 74 10 10028 74 10 10028 74 10 10028 74 10
5076 10028 74 10 10028 74 10 10028 74 10 10396 65 9 10396 65 9
5077 10396 65 9 10396 65 9 10396 65 9 10396 65 9 10396 65 9 10396 65 9
5078 10396 65 9 11002 81 11 11002 81 11 11002 81 11 11002 81 11
5079 11002 81 11 11002 81 11 11002 81 11 11002 81 11 11002 81 11
5080 11010 41 6 11010 41 6 11010 41 6 11010 41 6 11010 41 6 11441 57 8
5081 11441 57 8 11441 57 8 11441 57 8 11441 57 8 11441 57 8 11441 57 8
5082 11441 57 8 12529 46 7 12529 46 7 12529 46 7 12529 46 7 12529 46 7
5083 12529 46 7 12529 46 7 12529 46 7 12529 46 7 12529 46 7 12529 46 7}
5085 do_execsql_test 5.3.5.1 {
5086 SELECT max(c) OVER win,
5090 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE GROUP )
5091 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5092 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5093 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5094 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5095 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5096 {} {} 0 158 158 1 160 160 1 160 160 1 223 223 1 224 224 1
5097 238 234 2 239 234 2 239 238 2 252 250 2 256 252 2 257 247 4
5098 257 247 4 257 250 3 335 330 2 336 330 2 336 335 2 354 354 1
5099 354 354 1 355 355 1 398 393 3 398 393 3 399 393 3 399 398 2
5100 399 398 2 572 572 1 574 574 1 633 629 2 634 627 3 634 627 3
5101 634 627 3 634 629 3 667 667 1 670 667 2 671 667 2 671 670 2
5102 671 670 2 711 711 1 711 711 1 716 705 2 726 726 1 730 730 1
5103 762 762 1 762 762 1 762 762 1 768 759 3 792 790 2 792 790 2
5104 794 786 3 794 786 3 844 839 4 845 839 4 845 839 4 845 840 3
5105 845 840 3 934 934 1 934 934 1 934 934 1 938 929 3 959 959 1
5108 do_execsql_test 5.3.5.2 {
5109 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5111 dense_rank() OVER win
5113 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE GROUP )
5114 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5115 } {{} 1 1 {} 2 2 {} 2 2 {} 4 3 {} 5 4 {} 6 5 {} 6 5 {} 8 6
5116 {} 9 7 {} 10 8 {} 14 12 {} 15 13 {} 19 17 {} 20 18 {} 21 19
5117 {} 23 21 {} 25 23 {} 27 25 {} 27 25 {} 34 29 {} 35 30 {} 36 31
5118 {} 37 32 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 42 36 {} 43 37
5119 {} 43 37 {} 50 42 {} 56 47 {} 60 51 {} 61 52 {} 62 53 {} 64 55
5120 {} 64 55 {} 66 56 {} 67 57 {} 68 58 {} 69 59 {} 70 60 {} 71 61
5121 {} 72 62 {} 78 67 {} 78 67 {} 78 67 {} 81 68 {} 82 69 {} 83 70
5122 {} 85 72 {} 85 72 {} 89 75 223 11 9 239 12 10 239 13 11
5123 257 18 16 335 22 20 335 24 22 504 16 14 504 17 15 671 52 44
5124 671 52 44 705 58 49 710 26 24 711 57 48 711 59 50 759 63 54
5125 786 32 28 786 32 28 798 29 26 798 29 26 845 73 63 845 73 63
5126 929 84 71 959 88 74 963 87 73 1260 46 39 1260 46 39 1334 51 43
5127 1334 55 46 1584 31 27 1678 77 66 1885 48 40 1891 45 38 1891 49 41
5128 2005 54 45 2523 75 64 2523 76 65}
5130 do_execsql_test 5.3.6.1 {
5131 SELECT max(c) OVER win,
5135 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE GROUP )
5136 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5137 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5138 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5139 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5140 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5141 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5142 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5143 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5144 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5145 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5146 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5147 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5148 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5149 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0}
5151 do_execsql_test 5.3.6.2 {
5152 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5154 dense_rank() OVER win
5156 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE GROUP )
5157 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5158 } {{} 1 1 {} 2 2 {} 2 2 {} 4 3 {} 5 4 {} 6 5 {} 6 5 {} 8 6
5159 {} 9 7 {} 10 8 {} 11 9 {} 12 10 {} 13 11 {} 14 12 {} 15 13
5160 {} 16 14 {} 17 15 {} 18 16 {} 19 17 {} 20 18 {} 21 19 {} 22 20
5161 {} 23 21 {} 24 22 {} 25 23 {} 26 24 {} 27 25 {} 27 25 {} 29 26
5162 {} 29 26 {} 31 27 {} 32 28 {} 32 28 {} 34 29 {} 35 30 {} 36 31
5163 {} 37 32 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 42 36 {} 43 37
5164 {} 43 37 {} 45 38 {} 46 39 {} 46 39 {} 48 40 {} 49 41 {} 50 42
5165 {} 51 43 {} 52 44 {} 52 44 {} 54 45 {} 55 46 {} 56 47 {} 57 48
5166 {} 58 49 {} 59 50 {} 60 51 {} 61 52 {} 62 53 {} 63 54 {} 64 55
5167 {} 64 55 {} 66 56 {} 67 57 {} 68 58 {} 69 59 {} 70 60 {} 71 61
5168 {} 72 62 {} 73 63 {} 73 63 {} 75 64 {} 76 65 {} 77 66 {} 78 67
5169 {} 78 67 {} 78 67 {} 81 68 {} 82 69 {} 83 70 {} 84 71 {} 85 72
5170 {} 85 72 {} 87 73 {} 88 74 {} 89 75}
5172 do_execsql_test 5.3.7.1 {
5173 SELECT max(c) OVER win,
5177 WINDOW win AS ( ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
5178 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5179 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5180 } {963 929 6 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
5181 979 102 83 979 113 80 979 113 81 979 113 82 979 133 79 979 148 78
5182 979 158 76 979 158 77 979 160 76 979 208 75 979 223 74 979 224 73
5183 979 234 72 979 238 71 979 239 70 979 247 69 979 250 68 979 252 67
5184 979 256 66 979 257 65 979 295 64 979 309 64 979 330 62 979 335 61
5185 979 336 60 979 346 59 979 354 59 979 355 57 979 355 57 979 393 55
5186 979 393 56 979 398 54 979 399 53 979 399 53 979 412 52 979 421 51
5187 979 430 50 979 443 49 979 480 47 979 480 48 979 572 47 979 574 45
5188 979 607 44 979 618 42 979 618 43 979 627 41 979 629 40 979 629 41
5189 979 633 39 979 634 38 979 652 37 979 660 36 979 667 35 979 667 35
5190 979 670 34 979 671 33 979 683 32 979 705 31 979 711 30 979 716 29
5191 979 726 28 979 730 27 979 759 26 979 762 25 979 768 23 979 768 24
5192 979 777 22 979 786 21 979 790 20 979 792 19 979 794 18 979 805 17
5193 979 822 17 979 839 14 979 839 15 979 840 13 979 844 12 979 845 11
5194 979 870 9 979 870 10 979 870 10 979 899 8 979 911 7}
5196 do_execsql_test 5.3.7.2 {
5197 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5199 dense_rank() OVER win
5201 WINDOW win AS ( ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
5202 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5203 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5204 } {2851 89 89 3778 88 88 4681 87 87 5556 83 83 5574 82 82 5586 81 81
5205 5640 84 84 5640 85 85 5640 86 86 7324 80 80 8123 77 77 8129 73 73
5206 8129 74 74 8163 78 78 8163 79 79 8940 71 71 8968 75 75 8968 76 76
5207 9727 66 66 9745 69 69 9745 70 70 9745 72 72 10504 65 65
5208 10504 67 67 10504 68 68 11215 64 64 11844 62 62 11920 63 63
5209 13274 60 60 13274 61 61 13897 58 58 13903 57 57 13925 56 56
5210 13937 55 55 13941 59 59 15203 53 53 15241 54 54 15832 52 52
5211 17100 48 48 17104 46 46 17104 47 47 17106 45 45 17126 49 49
5212 17126 50 50 17126 51 51 17569 42 42 17733 44 44 18176 43 43
5213 18597 40 40 18597 41 41 18952 37 37 18996 39 39 19395 38 38
5214 19760 35 35 19788 36 36 20492 32 32 20492 33 33 20498 30 30
5215 20536 34 34 20833 29 29 20871 28 28 20891 31 31 21180 27 27
5216 21752 23 23 21830 26 26 22025 21 21 22087 22 22 22087 24 24
5217 22087 25 25 22278 20 20 22316 19 19 22549 15 15 22557 14 14
5218 22573 17 17 22573 18 18 22706 10 10 22796 11 11 22796 12 12
5219 22796 13 13 22796 16 16 23022 4 4 23042 2 2 23042 3 3 23042 9 9
5220 23155 1 1 23155 5 5 23155 6 6 23155 7 7 23155 8 8}
5222 do_execsql_test 5.3.8.1 {
5223 SELECT max(c) OVER win,
5227 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5228 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5229 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5230 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5231 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5232 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5233 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5234 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5235 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5236 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5237 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5238 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5239 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5240 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5241 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0}
5243 do_execsql_test 5.3.8.2 {
5244 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5246 dense_rank() OVER win
5248 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5249 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5250 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5251 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5252 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5253 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5254 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5255 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5256 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5257 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5258 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5259 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5260 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5263 do_execsql_test 5.3.9.1 {
5264 SELECT max(c) OVER win,
5268 WINDOW win AS ( ORDER BY a NULLS LAST
5269 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5270 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5271 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 870 158 0
5272 870 158 0 870 158 0 870 158 0 870 158 0 870 158 0 870 158 0
5273 870 158 0 870 158 0 899 113 9 899 113 9 899 113 9 899 113 9
5274 899 113 9 899 113 9 899 113 9 899 113 16 899 113 16 899 113 16
5275 899 113 16 899 113 16 899 113 16 899 113 16 899 113 16 899 113 16
5276 979 102 44 979 102 44 979 102 44 979 102 44 979 102 44 979 102 49
5277 979 102 49 979 102 49 979 102 49 979 102 49 979 102 49 979 102 49
5278 979 102 56 979 102 56 979 102 56 979 102 56 979 102 56 979 102 56
5279 979 102 62 979 102 62 979 102 62 979 102 62 979 102 62 979 102 62
5280 979 102 62 979 102 62 979 102 62 979 102 62 979 102 62 979 102 62
5281 979 102 62 979 102 75 979 102 75 979 102 75 979 102 75 979 102 75
5282 979 102 75 979 102 75 979 102 75 979 113 25 979 113 25 979 113 25
5283 979 113 25 979 113 25 979 113 25 979 113 25 979 113 25 979 113 33
5284 979 113 33 979 113 33 979 113 33 979 113 33 979 113 33 979 113 33
5285 979 113 33 979 113 33 979 113 33 979 113 33}
5287 do_execsql_test 5.3.9.2 {
5288 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5290 dense_rank() OVER win
5292 WINDOW win AS ( ORDER BY a NULLS LAST
5293 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5294 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5295 } {{} 84 11 {} 84 11 {} 84 11 {} 84 11 {} 84 11 {} 84 11
5296 2050 75 10 2050 75 10 2050 75 10 2050 75 10 2050 75 10 2050 75 10
5297 2050 75 10 2050 75 10 2050 75 10 4997 68 9 4997 68 9 4997 68 9
5298 4997 68 9 4997 68 9 4997 68 9 4997 68 9 7337 59 8 7337 59 8
5299 7337 59 8 7337 59 8 7337 59 8 7337 59 8 7337 59 8 7337 59 8
5300 7337 59 8 10450 51 7 10450 51 7 10450 51 7 10450 51 7 10450 51 7
5301 10450 51 7 10450 51 7 10450 51 7 11714 40 6 11714 40 6 11714 40 6
5302 11714 40 6 11714 40 6 11714 40 6 11714 40 6 11714 40 6 11714 40 6
5303 11714 40 6 11714 40 6 12676 35 5 12676 35 5 12676 35 5 12676 35 5
5304 12676 35 5 14195 28 4 14195 28 4 14195 28 4 14195 28 4 14195 28 4
5305 14195 28 4 14195 28 4 15999 22 3 15999 22 3 15999 22 3 15999 22 3
5306 15999 22 3 15999 22 3 17365 9 2 17365 9 2 17365 9 2 17365 9 2
5307 17365 9 2 17365 9 2 17365 9 2 17365 9 2 17365 9 2 17365 9 2
5308 17365 9 2 17365 9 2 17365 9 2 20846 1 1 20846 1 1 20846 1 1
5309 20846 1 1 20846 1 1 20846 1 1 20846 1 1 20846 1 1}
5311 do_execsql_test 5.3.10.1 {
5312 SELECT max(c) OVER win,
5316 WINDOW win AS ( PARTITION BY coalesce(a, '')
5317 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5318 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5319 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5320 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5321 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5322 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5323 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5324 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5325 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5326 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5327 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5328 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5329 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5330 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5331 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0}
5333 do_execsql_test 5.3.10.2 {
5334 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5336 dense_rank() OVER win
5338 WINDOW win AS ( PARTITION BY coalesce(a, '')
5339 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5340 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5341 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5342 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5343 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5344 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5345 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5346 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5347 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5348 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5349 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5350 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5351 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5354 do_execsql_test 5.3.11.1 {
5355 SELECT max(c) OVER win,
5359 WINDOW win AS ( ORDER BY a NULLS LAST GROUPS 6 PRECEDING EXCLUDE GROUP )
5360 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5361 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5362 {} {} 0 934 158 27 934 158 27 934 158 27 934 158 27 934 158 27
5363 934 158 27 934 158 27 934 223 8 934 223 8 934 223 8 934 223 8
5364 934 223 8 934 223 8 934 223 8 934 223 8 934 223 8 934 223 8
5365 934 223 8 934 223 8 934 223 8 934 223 21 934 223 21 934 223 21
5366 934 223 21 934 223 21 934 223 21 959 102 50 959 102 50 959 102 50
5367 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50
5368 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50 959 102 50
5369 959 102 50 959 102 50 959 113 39 959 113 39 959 113 39 959 113 39
5370 959 113 39 959 113 39 959 113 39 959 113 39 959 113 39 959 113 39
5371 959 113 39 959 158 34 959 158 34 959 158 34 959 158 34 959 158 34
5372 979 102 46 979 102 46 979 102 46 979 102 46 979 102 46 979 102 46
5373 979 102 46 979 102 47 979 102 47 979 102 47 979 102 47 979 102 47
5374 979 102 47 979 102 47 979 102 47 979 102 47 979 102 49 979 102 49
5375 979 102 49 979 102 49 979 102 49 979 102 49}
5377 do_execsql_test 5.3.11.2 {
5378 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5380 dense_rank() OVER win
5382 WINDOW win AS ( ORDER BY a NULLS LAST GROUPS 6 PRECEDING EXCLUDE GROUP )
5383 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5384 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5385 2309 9 2 2309 9 2 2309 9 2 2309 9 2 2309 9 2 2309 9 2 2309 9 2
5386 2309 9 2 2309 9 2 2309 9 2 2309 9 2 2309 9 2 2309 9 2 5790 22 3
5387 5790 22 3 5790 22 3 5790 22 3 5790 22 3 5790 22 3 7156 28 4
5388 7156 28 4 7156 28 4 7156 28 4 7156 28 4 7156 28 4 7156 28 4
5389 8960 35 5 8960 35 5 8960 35 5 8960 35 5 8960 35 5 10028 68 9
5390 10028 68 9 10028 68 9 10028 68 9 10028 68 9 10028 68 9 10028 68 9
5391 10396 59 8 10396 59 8 10396 59 8 10396 59 8 10396 59 8 10396 59 8
5392 10396 59 8 10396 59 8 10396 59 8 10479 40 6 10479 40 6 10479 40 6
5393 10479 40 6 10479 40 6 10479 40 6 10479 40 6 10479 40 6 10479 40 6
5394 10479 40 6 10479 40 6 11002 75 10 11002 75 10 11002 75 10
5395 11002 75 10 11002 75 10 11002 75 10 11002 75 10 11002 75 10
5396 11002 75 10 11441 51 7 11441 51 7 11441 51 7 11441 51 7
5397 11441 51 7 11441 51 7 11441 51 7 11441 51 7 12145 84 11
5398 12145 84 11 12145 84 11 12145 84 11 12145 84 11 12145 84 11}
5400 do_execsql_test 5.3.12.1 {
5401 SELECT max(c) OVER win,
5405 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE GROUP )
5406 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5407 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5408 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5409 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5410 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5411 {} {} 0 158 158 1 160 160 1 160 160 1 223 223 1 224 224 1
5412 238 234 2 239 234 2 239 238 2 252 250 2 256 252 2 257 247 4
5413 257 247 4 257 250 3 335 330 2 336 330 2 336 335 2 354 354 1
5414 354 354 1 355 355 1 398 393 3 398 393 3 399 393 3 399 398 2
5415 399 398 2 572 572 1 574 574 1 633 629 2 634 627 3 634 627 3
5416 634 627 3 634 629 3 667 667 1 670 667 2 671 667 2 671 670 2
5417 671 670 2 711 711 1 711 711 1 716 705 2 726 726 1 730 730 1
5418 762 762 1 762 762 1 762 762 1 768 759 3 792 790 2 792 790 2
5419 794 786 3 794 786 3 844 839 4 845 839 4 845 839 4 845 840 3
5420 845 840 3 934 934 1 934 934 1 934 934 1 938 929 3 959 959 1
5423 do_execsql_test 5.3.12.2 {
5424 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5426 dense_rank() OVER win
5428 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE GROUP )
5429 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5430 } {{} 1 1 {} 2 2 {} 2 2 {} 4 3 {} 5 4 {} 6 5 {} 6 5 {} 8 6
5431 {} 9 7 {} 10 8 {} 14 12 {} 15 13 {} 19 17 {} 20 18 {} 21 19
5432 {} 23 21 {} 25 23 {} 27 25 {} 27 25 {} 34 29 {} 35 30 {} 36 31
5433 {} 37 32 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 42 36 {} 43 37
5434 {} 43 37 {} 50 42 {} 56 47 {} 60 51 {} 61 52 {} 62 53 {} 64 55
5435 {} 64 55 {} 66 56 {} 67 57 {} 68 58 {} 69 59 {} 70 60 {} 71 61
5436 {} 72 62 {} 78 67 {} 78 67 {} 78 67 {} 81 68 {} 82 69 {} 83 70
5437 {} 85 72 {} 85 72 {} 89 75 223 11 9 239 12 10 239 13 11
5438 257 18 16 335 22 20 335 24 22 504 16 14 504 17 15 671 52 44
5439 671 52 44 705 58 49 710 26 24 711 57 48 711 59 50 759 63 54
5440 786 32 28 786 32 28 798 29 26 798 29 26 845 73 63 845 73 63
5441 929 84 71 959 88 74 963 87 73 1260 46 39 1260 46 39 1334 51 43
5442 1334 55 46 1584 31 27 1678 77 66 1885 48 40 1891 45 38 1891 49 41
5443 2005 54 45 2523 75 64 2523 76 65}
5445 do_execsql_test 5.3.13.1 {
5446 SELECT max(c) OVER win,
5450 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE GROUP )
5451 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5452 } {{} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5453 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5454 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5455 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5456 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5457 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5458 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5459 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5460 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5461 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5462 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5463 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0
5464 {} {} 0 {} {} 0 {} {} 0 {} {} 0 {} {} 0}
5466 do_execsql_test 5.3.13.2 {
5467 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5469 dense_rank() OVER win
5471 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE GROUP )
5472 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5473 } {{} 1 1 {} 2 2 {} 2 2 {} 4 3 {} 5 4 {} 6 5 {} 6 5 {} 8 6
5474 {} 9 7 {} 10 8 {} 11 9 {} 12 10 {} 13 11 {} 14 12 {} 15 13
5475 {} 16 14 {} 17 15 {} 18 16 {} 19 17 {} 20 18 {} 21 19 {} 22 20
5476 {} 23 21 {} 24 22 {} 25 23 {} 26 24 {} 27 25 {} 27 25 {} 29 26
5477 {} 29 26 {} 31 27 {} 32 28 {} 32 28 {} 34 29 {} 35 30 {} 36 31
5478 {} 37 32 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 42 36 {} 43 37
5479 {} 43 37 {} 45 38 {} 46 39 {} 46 39 {} 48 40 {} 49 41 {} 50 42
5480 {} 51 43 {} 52 44 {} 52 44 {} 54 45 {} 55 46 {} 56 47 {} 57 48
5481 {} 58 49 {} 59 50 {} 60 51 {} 61 52 {} 62 53 {} 63 54 {} 64 55
5482 {} 64 55 {} 66 56 {} 67 57 {} 68 58 {} 69 59 {} 70 60 {} 71 61
5483 {} 72 62 {} 73 63 {} 73 63 {} 75 64 {} 76 65 {} 77 66 {} 78 67
5484 {} 78 67 {} 78 67 {} 81 68 {} 82 69 {} 83 70 {} 84 71 {} 85 72
5485 {} 85 72 {} 87 73 {} 88 74 {} 89 75}
5487 do_execsql_test 5.3.14.1 {
5488 SELECT max(c) OVER win,
5492 WINDOW win AS ( ORDER BY c NULLS LAST, b NULLS LAST, a NULLS LAST
5493 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5494 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5495 } {963 929 6 979 102 82 979 102 82 979 102 82 979 102 82 979 102 82
5496 979 102 83 979 113 80 979 113 81 979 113 82 979 133 79 979 148 78
5497 979 158 76 979 158 77 979 160 76 979 208 75 979 223 74 979 224 73
5498 979 234 72 979 238 71 979 239 70 979 247 69 979 250 68 979 252 67
5499 979 256 66 979 257 65 979 295 64 979 309 63 979 330 63 979 335 61
5500 979 336 60 979 346 59 979 354 58 979 355 56 979 355 58 979 393 55
5501 979 393 56 979 398 54 979 399 52 979 399 53 979 412 52 979 421 51
5502 979 430 50 979 443 49 979 480 47 979 480 48 979 572 46 979 574 46
5503 979 607 44 979 618 42 979 618 43 979 627 41 979 629 40 979 629 40
5504 979 633 39 979 634 38 979 652 37 979 660 36 979 667 34 979 667 35
5505 979 670 34 979 671 33 979 683 32 979 705 31 979 711 30 979 716 29
5506 979 726 28 979 730 27 979 759 26 979 762 25 979 768 23 979 768 24
5507 979 777 22 979 786 21 979 790 20 979 792 19 979 794 18 979 805 17
5508 979 822 16 979 839 15 979 839 15 979 840 13 979 844 12 979 845 11
5509 979 870 8 979 870 9 979 870 10 979 899 8 979 911 7}
5511 do_execsql_test 5.3.14.2 {
5512 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5514 dense_rank() OVER win
5516 WINDOW win AS ( ORDER BY c NULLS LAST, b NULLS LAST, a NULLS LAST
5517 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE GROUP )
5518 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5519 } {2851 89 89 3778 88 88 4681 87 87 5556 83 83 5574 82 82 5586 81 81
5520 5640 84 84 5640 85 85 5640 86 86 7324 80 80 8123 77 77 8129 73 73
5521 8129 74 74 8163 78 78 8163 79 79 8940 71 71 8968 75 75 8968 76 76
5522 9727 66 66 9745 69 69 9745 70 70 9745 72 72 10504 65 65
5523 10504 67 67 10504 68 68 11215 64 64 11844 62 62 11920 63 63
5524 13274 60 60 13274 61 61 13897 58 58 13903 57 57 13925 56 56
5525 13937 55 55 13941 59 59 15203 53 53 15241 54 54 15832 52 52
5526 17100 48 48 17104 46 46 17104 47 47 17106 45 45 17126 49 49
5527 17126 50 50 17126 51 51 17569 42 42 17733 44 44 18176 43 43
5528 18597 40 40 18597 41 41 18952 37 37 18996 39 39 19395 38 38
5529 19760 35 35 19788 36 36 20492 32 32 20492 33 33 20498 30 30
5530 20536 34 34 20833 29 29 20871 28 28 20891 31 31 21180 27 27
5531 21752 23 23 21830 26 26 22025 21 21 22087 22 22 22087 24 24
5532 22087 25 25 22278 20 20 22316 19 19 22549 15 15 22557 14 14
5533 22573 17 17 22573 18 18 22706 10 10 22796 11 11 22796 12 12
5534 22796 13 13 22796 16 16 23022 4 4 23042 2 2 23042 3 3 23042 9 9
5535 23155 1 1 23155 5 5 23155 6 6 23155 7 7 23155 8 8}
5537 do_execsql_test 5.4.1.1 {
5538 SELECT max(c) OVER win,
5542 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5543 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5544 } {102 102 1 113 113 1 113 113 1 133 133 1 148 148 1 158 158 0
5545 158 158 1 160 160 1 208 208 1 223 223 1 224 224 1 234 234 1
5546 238 238 1 239 239 1 247 247 1 250 250 1 252 252 1 256 256 1
5547 257 257 1 295 295 1 309 309 1 330 330 1 335 335 1 336 336 1
5548 346 346 1 354 354 1 355 355 0 355 355 1 393 393 1 393 393 1
5549 398 398 1 399 399 0 399 399 1 412 412 1 421 421 1 430 430 1
5550 443 443 1 480 480 1 480 480 1 572 572 1 574 574 1 607 607 1
5551 618 618 1 618 618 1 627 627 1 629 629 0 629 629 1 633 633 1
5552 634 634 1 652 652 1 660 660 1 667 667 0 667 667 1 670 670 1
5553 671 671 1 683 683 1 705 705 1 711 711 1 716 716 1 726 726 1
5554 730 730 1 759 759 1 762 762 1 768 768 1 768 768 1 777 777 1
5555 786 786 1 790 790 1 792 792 1 794 794 1 805 805 1 822 822 1
5556 839 839 1 839 839 1 840 840 1 844 844 1 845 845 1 870 870 0
5557 870 870 1 870 870 1 899 899 1 911 911 1 929 929 1 934 934 1
5558 938 938 1 938 938 1 959 959 1 963 963 1 979 979 1}
5560 do_execsql_test 5.4.1.2 {
5561 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5563 dense_rank() OVER win
5565 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5566 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5567 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5568 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5569 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5570 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5571 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5572 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5573 113 1 1 113 1 1 133 1 1 223 1 1 239 1 1 247 1 1 257 1 1
5574 295 1 1 309 1 1 335 1 1 355 1 1 355 1 1 393 1 1 393 1 1
5575 399 1 1 399 1 1 421 1 1 443 1 1 607 1 1 627 1 1 629 1 1
5576 629 1 1 633 1 1 667 1 1 667 1 1 671 1 1 683 1 1 705 1 1
5577 711 1 1 759 1 1 777 1 1 805 1 1 839 1 1 839 1 1 845 1 1
5578 899 1 1 911 1 1 929 1 1 959 1 1 963 1 1 979 1 1}
5580 do_execsql_test 5.4.2.1 {
5581 SELECT max(c) OVER win,
5585 WINDOW win AS ( ORDER BY a NULLS FIRST
5586 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5587 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5588 } {113 113 1 234 234 1 257 257 1 336 336 1 354 354 1 768 768 1
5589 839 839 1 839 839 1 899 113 10 899 113 10 899 113 10 899 113 10
5590 899 113 10 899 113 10 899 113 10 899 113 17 899 113 17 899 113 17
5591 899 113 17 899 113 17 899 113 17 899 113 17 899 899 1 963 113 17
5592 979 102 34 979 102 45 979 102 45 979 102 45 979 102 45 979 102 45
5593 979 102 50 979 102 50 979 102 50 979 102 50 979 102 50 979 102 50
5594 979 102 50 979 102 57 979 102 57 979 102 57 979 102 57 979 102 57
5595 979 102 57 979 102 63 979 102 63 979 102 63 979 102 63 979 102 63
5596 979 102 63 979 102 63 979 102 63 979 102 63 979 102 63 979 102 63
5597 979 102 63 979 102 63 979 102 76 979 102 76 979 102 76 979 102 76
5598 979 102 76 979 102 76 979 102 76 979 102 76 979 102 83 979 102 83
5599 979 102 83 979 102 83 979 102 83 979 102 83 979 113 17 979 113 26
5600 979 113 26 979 113 26 979 113 26 979 113 26 979 113 26 979 113 26
5601 979 113 26 979 113 34 979 113 34 979 113 34 979 113 34 979 113 34
5602 979 113 34 979 113 34 979 113 34 979 113 34 979 113 34}
5604 do_execsql_test 5.4.2.2 {
5605 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5607 dense_rank() OVER win
5609 WINDOW win AS ( ORDER BY a NULLS FIRST
5610 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5611 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5612 } {{} 81 11 {} 81 11 {} 81 11 {} 81 11 113 81 11 257 81 11
5613 839 81 11 839 81 11 899 81 11 2947 74 10 2947 74 10 2947 74 10
5614 3368 74 10 3390 74 10 3618 74 10 3752 74 10 5287 65 9 5287 65 9
5615 5287 65 9 5287 65 9 5420 65 9 5642 65 9 5970 65 9 6250 65 9
5616 6266 65 9 8400 57 8 8400 57 8 8400 57 8 8400 57 8 8400 57 8
5617 8400 57 8 8735 57 8 9329 57 8 9664 46 7 9664 46 7 9664 46 7
5618 9664 46 7 9664 46 7 9664 46 7 9664 46 7 9664 46 7 9664 46 7
5619 9959 46 7 10331 46 7 10626 41 6 10626 41 6 10739 41 6 11255 41 6
5620 11403 41 6 12145 34 5 12145 34 5 12145 34 5 12145 34 5 12145 34 5
5621 12990 34 5 13104 34 5 13949 28 4 13949 28 4 13949 28 4 13949 28 4
5622 14556 28 4 14708 28 4 15315 15 3 15315 15 3 15315 15 3 15315 15 3
5623 15315 15 3 15315 15 3 15562 15 3 15708 15 3 15708 15 3 15714 15 3
5624 15948 15 3 16020 15 3 16026 15 3 18796 7 2 18796 7 2 18796 7 2
5625 19019 7 2 19035 7 2 19105 7 2 19423 7 2 19707 7 2 21105 1 1
5626 21105 1 1 21460 1 1 21504 1 1 21734 1 1 21772 1 1}
5628 do_execsql_test 5.4.3.1 {
5629 SELECT max(c) OVER win,
5633 WINDOW win AS ( PARTITION BY coalesce(a, '')
5634 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5635 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5636 } {102 102 1 113 113 1 113 113 1 133 133 1 148 148 1 158 158 0
5637 158 158 1 160 160 1 208 208 1 223 223 1 224 224 1 234 234 1
5638 238 238 1 239 239 1 247 247 1 250 250 1 252 252 1 256 256 1
5639 257 257 1 295 295 1 309 309 1 330 330 1 335 335 1 336 336 1
5640 346 346 1 354 354 1 355 355 0 355 355 1 393 393 1 393 393 1
5641 398 398 1 399 399 0 399 399 1 412 412 1 421 421 1 430 430 1
5642 443 443 1 480 480 1 480 480 1 572 572 1 574 574 1 607 607 1
5643 618 618 1 618 618 1 627 627 1 629 629 0 629 629 1 633 633 1
5644 634 634 1 652 652 1 660 660 1 667 667 0 667 667 1 670 670 1
5645 671 671 1 683 683 1 705 705 1 711 711 1 716 716 1 726 726 1
5646 730 730 1 759 759 1 762 762 1 768 768 1 768 768 1 777 777 1
5647 786 786 1 790 790 1 792 792 1 794 794 1 805 805 1 822 822 1
5648 839 839 1 839 839 1 840 840 1 844 844 1 845 845 1 870 870 0
5649 870 870 1 870 870 1 899 899 1 911 911 1 929 929 1 934 934 1
5650 938 938 1 938 938 1 959 959 1 963 963 1 979 979 1}
5652 do_execsql_test 5.4.3.2 {
5653 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5655 dense_rank() OVER win
5657 WINDOW win AS ( PARTITION BY coalesce(a, '')
5658 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5659 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5660 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5661 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5662 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5663 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5664 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5665 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5666 113 1 1 113 1 1 133 1 1 223 1 1 239 1 1 247 1 1 257 1 1
5667 295 1 1 309 1 1 335 1 1 355 1 1 355 1 1 393 1 1 393 1 1
5668 399 1 1 399 1 1 421 1 1 443 1 1 607 1 1 627 1 1 629 1 1
5669 629 1 1 633 1 1 667 1 1 667 1 1 671 1 1 683 1 1 705 1 1
5670 711 1 1 759 1 1 777 1 1 805 1 1 839 1 1 839 1 1 845 1 1
5671 899 1 1 911 1 1 929 1 1 959 1 1 963 1 1 979 1 1}
5673 do_execsql_test 5.4.4.1 {
5674 SELECT max(c) OVER win,
5678 WINDOW win AS ( ORDER BY a NULLS FIRST GROUPS 6 PRECEDING EXCLUDE TIES )
5679 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5680 } {158 158 0 355 355 0 399 399 0 629 629 0 667 667 0 870 158 1
5681 870 158 1 870 158 1 870 158 1 870 158 1 870 158 1 870 870 0
5682 911 158 1 934 158 1 934 158 9 934 158 9 934 158 9 934 158 9
5683 934 158 9 934 158 9 934 158 9 934 158 9 934 158 9 934 158 9
5684 934 158 9 934 158 9 934 158 9 934 158 22 934 158 22 934 158 22
5685 934 158 22 934 158 22 934 158 22 934 158 28 934 158 28 934 158 28
5686 934 158 28 934 158 28 934 158 28 959 102 40 959 102 51 959 102 51
5687 959 102 51 959 102 51 959 102 51 959 102 51 959 102 51 959 102 51
5688 959 102 51 959 102 51 959 102 51 959 102 51 959 102 51 959 102 51
5689 959 102 51 959 113 35 959 113 40 959 113 40 959 113 40 959 113 40
5690 959 113 40 959 113 40 959 113 40 959 113 40 959 113 40 959 113 40
5691 959 158 28 959 158 35 959 158 35 959 158 35 959 158 35 963 102 51
5692 979 102 47 979 102 47 979 102 47 979 102 47 979 102 47 979 102 47
5693 979 102 47 979 102 48 979 102 48 979 102 48 979 102 48 979 102 48
5694 979 102 48 979 102 48 979 102 48 979 102 48 979 102 51}
5696 do_execsql_test 5.4.4.2 {
5697 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5699 dense_rank() OVER win
5701 WINDOW win AS ( ORDER BY a NULLS FIRST GROUPS 6 PRECEDING EXCLUDE TIES )
5702 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5703 } {{} 1 1 {} 1 1 355 1 1 399 1 1 629 1 1 667 1 1 2050 7 2
5704 2050 7 2 2050 7 2 2273 7 2 2289 7 2 2359 7 2 2677 7 2 2961 7 2
5705 4359 15 3 4359 15 3 4359 15 3 4359 15 3 4359 15 3 4359 15 3
5706 4606 15 3 4752 15 3 4752 15 3 4758 15 3 4992 15 3 5064 15 3
5707 5070 15 3 7840 28 4 7840 28 4 7840 28 4 7840 28 4 8447 28 4
5708 8599 28 4 9206 34 5 9206 34 5 9206 34 5 9206 34 5 9206 34 5
5709 10028 74 10 10028 74 10 10028 74 10 10051 34 5 10165 34 5
5710 10396 65 9 10396 65 9 10396 65 9 10396 65 9 10449 74 10
5711 10471 74 10 10529 65 9 10699 74 10 10751 65 9 10833 74 10
5712 11002 81 11 11002 81 11 11002 81 11 11002 81 11 11010 41 6
5713 11010 41 6 11079 65 9 11115 81 11 11123 41 6 11259 81 11
5714 11359 65 9 11375 65 9 11441 57 8 11441 57 8 11441 57 8 11441 57 8
5715 11441 57 8 11441 57 8 11639 41 6 11776 57 8 11787 41 6
5716 11841 81 11 11841 81 11 11901 81 11 12370 57 8 12529 46 7
5717 12529 46 7 12529 46 7 12529 46 7 12529 46 7 12529 46 7 12529 46 7
5718 12529 46 7 12529 46 7 12824 46 7 13196 46 7}
5720 do_execsql_test 5.4.5.1 {
5721 SELECT max(c) OVER win,
5725 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE TIES )
5726 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5727 } {102 102 1 113 113 1 113 113 1 133 133 1 148 148 1 160 158 1
5728 160 158 2 160 158 2 208 208 1 224 223 2 224 223 2 239 234 3
5729 239 234 3 239 234 3 252 247 3 257 247 5 257 247 5 257 250 4
5730 257 252 3 295 295 1 309 309 1 336 330 3 336 330 3 336 330 3
5731 346 346 1 355 354 1 355 354 2 355 354 2 399 393 3 399 393 3
5732 399 393 3 399 393 4 399 393 4 412 412 1 421 421 1 430 430 1
5733 443 443 1 480 480 1 480 480 1 574 572 2 574 572 2 607 607 1
5734 618 618 1 618 618 1 634 627 3 634 627 4 634 627 4 634 627 4
5735 634 629 3 652 652 1 667 660 2 671 667 2 671 667 3 671 667 3
5736 671 667 3 683 683 1 711 705 2 716 705 3 716 711 2 730 726 2
5737 730 726 2 762 759 2 768 759 4 768 762 2 768 762 2 777 777 1
5738 792 786 3 794 786 4 794 786 4 794 790 3 805 805 1 822 822 1
5739 845 839 4 845 839 4 845 839 5 845 839 5 845 839 5 870 870 0
5740 870 870 1 870 870 1 899 899 1 911 911 1 934 929 2 938 929 4
5741 938 934 2 938 934 2 963 959 2 963 959 2 979 979 1}
5743 do_execsql_test 5.4.5.2 {
5744 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5746 dense_rank() OVER win
5748 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE TIES )
5749 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5750 } {{} 1 1 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 25 23 {} 34 29
5751 {} 36 31 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 43 37 {} 43 37
5752 {} 50 42 {} 60 51 {} 61 52 {} 64 55 {} 64 55 {} 67 57 {} 68 58
5753 {} 69 59 {} 70 60 {} 72 62 {} 78 67 {} 78 67 {} 78 67 {} 85 72
5754 {} 85 72 113 2 2 113 2 2 133 4 3 223 10 8 223 11 9 239 12 10
5755 239 13 11 239 14 12 247 15 13 257 18 16 257 19 17 295 20 18
5756 309 21 19 335 22 20 335 23 21 335 24 22 355 27 25 355 27 25
5757 421 35 30 443 37 32 504 16 14 504 17 15 607 42 36 683 56 47
5758 710 26 24 711 59 50 759 62 53 759 63 54 777 66 56 805 71 61
5759 899 81 68 911 82 69 929 83 70 929 84 71 979 89 75 1185 32 28
5760 1185 32 28 1191 29 26 1191 29 26 1334 51 43 1338 52 44 1338 52 44
5761 1416 57 48 1416 58 49 1584 31 27 1684 73 63 1684 73 63 1889 46 39
5762 1889 46 39 1891 49 41 1922 87 73 1922 88 74 2005 54 45 2005 55 46
5763 2518 45 38 2518 48 40 2523 75 64 2523 76 65 2523 77 66}
5765 do_execsql_test 5.4.6.1 {
5766 SELECT max(c) OVER win,
5770 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE TIES )
5771 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5772 } {102 102 1 113 113 1 113 113 1 133 133 1 148 148 1 158 158 0
5773 158 158 1 160 160 1 208 208 1 223 223 1 224 224 1 234 234 1
5774 238 238 1 239 239 1 247 247 1 250 250 1 252 252 1 256 256 1
5775 257 257 1 295 295 1 309 309 1 330 330 1 335 335 1 336 336 1
5776 346 346 1 354 354 1 355 355 0 355 355 1 393 393 1 393 393 1
5777 398 398 1 399 399 0 399 399 1 412 412 1 421 421 1 430 430 1
5778 443 443 1 480 480 1 480 480 1 572 572 1 574 574 1 607 607 1
5779 618 618 1 618 618 1 627 627 1 629 629 0 629 629 1 633 633 1
5780 634 634 1 652 652 1 660 660 1 667 667 0 667 667 1 670 670 1
5781 671 671 1 683 683 1 705 705 1 711 711 1 716 716 1 726 726 1
5782 730 730 1 759 759 1 762 762 1 768 768 1 768 768 1 777 777 1
5783 786 786 1 790 790 1 792 792 1 794 794 1 805 805 1 822 822 1
5784 839 839 1 839 839 1 840 840 1 844 844 1 845 845 1 870 870 0
5785 870 870 1 870 870 1 899 899 1 911 911 1 929 929 1 934 934 1
5786 938 938 1 938 938 1 959 959 1 963 963 1 979 979 1}
5788 do_execsql_test 5.4.6.2 {
5789 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5791 dense_rank() OVER win
5793 WINDOW win AS ( ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE TIES )
5794 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5795 } {{} 1 1 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 11 9 {} 12 10
5796 {} 13 11 {} 16 14 {} 17 15 {} 18 16 {} 22 20 {} 24 22 {} 25 23
5797 {} 26 24 {} 31 27 {} 34 29 {} 36 31 {} 38 33 {} 38 33 {} 40 34
5798 {} 41 35 {} 43 37 {} 43 37 {} 49 41 {} 50 42 {} 51 43 {} 54 45
5799 {} 59 50 {} 60 51 {} 61 52 {} 63 54 {} 64 55 {} 64 55 {} 67 57
5800 {} 68 58 {} 69 59 {} 70 60 {} 72 62 {} 75 64 {} 76 65 {} 78 67
5801 {} 78 67 {} 78 67 {} 84 71 {} 85 72 {} 85 72 113 2 2 113 2 2
5802 133 4 3 223 10 8 239 14 12 247 15 13 257 19 17 295 20 18
5803 309 21 19 335 23 21 355 27 25 355 27 25 393 29 26 393 29 26
5804 399 32 28 399 32 28 421 35 30 443 37 32 607 42 36 627 45 38
5805 629 46 39 629 46 39 633 48 40 667 52 44 667 52 44 671 55 46
5806 683 56 47 705 57 48 711 58 49 759 62 53 777 66 56 805 71 61
5807 839 73 63 839 73 63 845 77 66 899 81 68 911 82 69 929 83 70
5808 959 87 73 963 88 74 979 89 75}
5810 do_execsql_test 5.4.7.1 {
5811 SELECT max(c) OVER win,
5815 WINDOW win AS ( ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
5816 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5817 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5818 } {979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
5819 979 102 83 979 113 81 979 113 82 979 133 80 979 148 79 979 158 77
5820 979 158 78 979 160 77 979 208 76 979 223 75 979 224 74 979 234 73
5821 979 238 72 979 239 71 979 247 70 979 250 69 979 252 68 979 256 67
5822 979 257 66 979 295 65 979 309 64 979 330 63 979 335 62 979 336 61
5823 979 346 60 979 354 59 979 355 58 979 355 58 979 393 56 979 393 57
5824 979 398 55 979 399 54 979 399 54 979 412 53 979 421 52 979 430 51
5825 979 443 50 979 480 48 979 480 49 979 572 47 979 574 46 979 607 45
5826 979 618 43 979 618 44 979 627 42 979 629 41 979 629 41 979 633 40
5827 979 634 39 979 652 38 979 660 37 979 667 36 979 667 36 979 670 35
5828 979 671 34 979 683 33 979 705 32 979 711 31 979 716 30 979 726 29
5829 979 730 28 979 759 27 979 762 26 979 768 24 979 768 25 979 777 23
5830 979 786 22 979 790 21 979 792 20 979 794 19 979 805 18 979 822 17
5831 979 839 15 979 839 16 979 840 14 979 844 13 979 845 12 979 870 10
5832 979 870 11 979 870 11 979 899 9 979 911 8 979 929 7}
5834 do_execsql_test 5.4.7.2 {
5835 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5837 dense_rank() OVER win
5839 WINDOW win AS ( ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
5840 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5841 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5842 } {3830 89 89 4741 88 88 5640 84 84 5640 85 85 5640 86 86 5640 87 87
5843 6485 81 81 6485 82 82 6485 83 83 7324 80 80 8163 78 78 8163 79 79
5844 8968 73 73 8968 74 74 8968 75 75 8968 76 76 8968 77 77 9745 69 69
5845 9745 70 70 9745 71 71 9745 72 72 10504 65 65 10504 66 66
5846 10504 67 67 10504 68 68 11215 64 64 11920 63 63 12603 62 62
5847 13274 60 60 13274 61 61 13941 59 59 14608 55 55 14608 56 56
5848 14608 57 57 14608 58 58 15241 54 54 15870 53 53 16499 52 52
5849 17126 49 49 17126 50 50 17126 51 51 17733 44 44 17733 45 45
5850 17733 46 46 17733 47 47 17733 48 48 18176 42 42 18176 43 43
5851 18597 40 40 18597 41 41 18996 39 39 19395 37 37 19395 38 38
5852 19788 36 36 20181 35 35 20536 34 34 20891 30 30 20891 31 31
5853 20891 32 32 20891 33 33 21226 28 28 21226 29 29 21535 27 27
5854 21830 26 26 22087 22 22 22087 23 23 22087 24 24 22087 25 25
5855 22334 21 21 22573 17 17 22573 18 18 22573 19 19 22573 20 20
5856 22796 11 11 22796 12 12 22796 13 13 22796 14 14 22796 15 15
5857 22796 16 16 22929 10 10 23042 9 9 23155 1 1 23155 2 2 23155 3 3
5858 23155 4 4 23155 5 5 23155 6 6 23155 7 7 23155 8 8}
5860 do_execsql_test 5.4.8.1 {
5861 SELECT max(c) OVER win,
5865 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5866 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5867 } {102 102 1 113 113 1 113 113 1 133 133 1 148 148 1 158 158 0
5868 158 158 1 160 160 1 208 208 1 223 223 1 224 224 1 234 234 1
5869 238 238 1 239 239 1 247 247 1 250 250 1 252 252 1 256 256 1
5870 257 257 1 295 295 1 309 309 1 330 330 1 335 335 1 336 336 1
5871 346 346 1 354 354 1 355 355 0 355 355 1 393 393 1 393 393 1
5872 398 398 1 399 399 0 399 399 1 412 412 1 421 421 1 430 430 1
5873 443 443 1 480 480 1 480 480 1 572 572 1 574 574 1 607 607 1
5874 618 618 1 618 618 1 627 627 1 629 629 0 629 629 1 633 633 1
5875 634 634 1 652 652 1 660 660 1 667 667 0 667 667 1 670 670 1
5876 671 671 1 683 683 1 705 705 1 711 711 1 716 716 1 726 726 1
5877 730 730 1 759 759 1 762 762 1 768 768 1 768 768 1 777 777 1
5878 786 786 1 790 790 1 792 792 1 794 794 1 805 805 1 822 822 1
5879 839 839 1 839 839 1 840 840 1 844 844 1 845 845 1 870 870 0
5880 870 870 1 870 870 1 899 899 1 911 911 1 929 929 1 934 934 1
5881 938 938 1 938 938 1 959 959 1 963 963 1 979 979 1}
5883 do_execsql_test 5.4.8.2 {
5884 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5886 dense_rank() OVER win
5888 WINDOW win AS ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5889 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5890 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5891 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5892 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5893 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5894 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5895 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5896 113 1 1 113 1 1 133 1 1 223 1 1 239 1 1 247 1 1 257 1 1
5897 295 1 1 309 1 1 335 1 1 355 1 1 355 1 1 393 1 1 393 1 1
5898 399 1 1 399 1 1 421 1 1 443 1 1 607 1 1 627 1 1 629 1 1
5899 629 1 1 633 1 1 667 1 1 667 1 1 671 1 1 683 1 1 705 1 1
5900 711 1 1 759 1 1 777 1 1 805 1 1 839 1 1 839 1 1 845 1 1
5901 899 1 1 911 1 1 929 1 1 959 1 1 963 1 1 979 1 1}
5903 do_execsql_test 5.4.9.1 {
5904 SELECT max(c) OVER win,
5908 WINDOW win AS ( ORDER BY a NULLS LAST
5909 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5910 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5911 } {158 158 0 355 355 0 399 399 0 629 629 0 667 667 0 870 113 1
5912 870 158 1 870 158 1 870 158 1 870 158 1 870 158 1 870 158 1
5913 870 158 1 870 870 0 899 113 10 899 113 10 899 113 10 899 113 10
5914 899 113 10 899 113 10 899 113 10 899 113 17 899 113 17 899 113 17
5915 899 113 17 899 113 17 899 113 17 899 113 17 899 158 1 963 113 17
5916 979 102 34 979 102 45 979 102 45 979 102 45 979 102 45 979 102 45
5917 979 102 50 979 102 50 979 102 50 979 102 50 979 102 50 979 102 50
5918 979 102 50 979 102 57 979 102 57 979 102 57 979 102 57 979 102 57
5919 979 102 57 979 102 63 979 102 63 979 102 63 979 102 63 979 102 63
5920 979 102 63 979 102 63 979 102 63 979 102 63 979 102 63 979 102 63
5921 979 102 63 979 102 63 979 102 76 979 102 76 979 102 76 979 102 76
5922 979 102 76 979 102 76 979 102 76 979 102 76 979 113 17 979 113 26
5923 979 113 26 979 113 26 979 113 26 979 113 26 979 113 26 979 113 26
5924 979 113 26 979 113 34 979 113 34 979 113 34 979 113 34 979 113 34
5925 979 113 34 979 113 34 979 113 34 979 113 34 979 113 34}
5927 do_execsql_test 5.4.9.2 {
5928 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5930 dense_rank() OVER win
5932 WINDOW win AS ( ORDER BY a NULLS LAST
5933 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5934 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5935 } {{} 84 11 {} 84 11 355 84 11 399 84 11 629 84 11 667 84 11
5936 2050 75 10 2050 75 10 2050 75 10 2050 75 10 2163 75 10 2307 75 10
5937 2889 75 10 2889 75 10 2949 75 10 4997 68 9 4997 68 9 4997 68 9
5938 5418 68 9 5440 68 9 5668 68 9 5802 68 9 7337 59 8 7337 59 8
5939 7337 59 8 7337 59 8 7470 59 8 7692 59 8 8020 59 8 8300 59 8
5940 8316 59 8 10450 51 7 10450 51 7 10450 51 7 10450 51 7 10450 51 7
5941 10450 51 7 10785 51 7 11379 51 7 11714 40 6 11714 40 6 11714 40 6
5942 11714 40 6 11714 40 6 11714 40 6 11714 40 6 11714 40 6 11714 40 6
5943 12009 40 6 12381 40 6 12676 35 5 12676 35 5 12789 35 5 13305 35 5
5944 13453 35 5 14195 28 4 14195 28 4 14195 28 4 14195 28 4 14195 28 4
5945 15040 28 4 15154 28 4 15999 22 3 15999 22 3 15999 22 3 15999 22 3
5946 16606 22 3 16758 22 3 17365 9 2 17365 9 2 17365 9 2 17365 9 2
5947 17365 9 2 17365 9 2 17612 9 2 17758 9 2 17758 9 2 17764 9 2
5948 17998 9 2 18070 9 2 18076 9 2 20846 1 1 20846 1 1 20846 1 1
5949 21069 1 1 21085 1 1 21155 1 1 21473 1 1 21757 1 1}
5951 do_execsql_test 5.4.10.1 {
5952 SELECT max(c) OVER win,
5956 WINDOW win AS ( PARTITION BY coalesce(a, '')
5957 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5958 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5959 } {102 102 1 113 113 1 113 113 1 133 133 1 148 148 1 158 158 0
5960 158 158 1 160 160 1 208 208 1 223 223 1 224 224 1 234 234 1
5961 238 238 1 239 239 1 247 247 1 250 250 1 252 252 1 256 256 1
5962 257 257 1 295 295 1 309 309 1 330 330 1 335 335 1 336 336 1
5963 346 346 1 354 354 1 355 355 0 355 355 1 393 393 1 393 393 1
5964 398 398 1 399 399 0 399 399 1 412 412 1 421 421 1 430 430 1
5965 443 443 1 480 480 1 480 480 1 572 572 1 574 574 1 607 607 1
5966 618 618 1 618 618 1 627 627 1 629 629 0 629 629 1 633 633 1
5967 634 634 1 652 652 1 660 660 1 667 667 0 667 667 1 670 670 1
5968 671 671 1 683 683 1 705 705 1 711 711 1 716 716 1 726 726 1
5969 730 730 1 759 759 1 762 762 1 768 768 1 768 768 1 777 777 1
5970 786 786 1 790 790 1 792 792 1 794 794 1 805 805 1 822 822 1
5971 839 839 1 839 839 1 840 840 1 844 844 1 845 845 1 870 870 0
5972 870 870 1 870 870 1 899 899 1 911 911 1 929 929 1 934 934 1
5973 938 938 1 938 938 1 959 959 1 963 963 1 979 979 1}
5975 do_execsql_test 5.4.10.2 {
5976 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
5978 dense_rank() OVER win
5980 WINDOW win AS ( PARTITION BY coalesce(a, '')
5981 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES )
5982 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
5983 } {{} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5984 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5985 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5986 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5987 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5988 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1 {} 1 1
5989 113 1 1 113 1 1 133 1 1 223 1 1 239 1 1 247 1 1 257 1 1
5990 295 1 1 309 1 1 335 1 1 355 1 1 355 1 1 393 1 1 393 1 1
5991 399 1 1 399 1 1 421 1 1 443 1 1 607 1 1 627 1 1 629 1 1
5992 629 1 1 633 1 1 667 1 1 667 1 1 671 1 1 683 1 1 705 1 1
5993 711 1 1 759 1 1 777 1 1 805 1 1 839 1 1 839 1 1 845 1 1
5994 899 1 1 911 1 1 929 1 1 959 1 1 963 1 1 979 1 1}
5996 do_execsql_test 5.4.11.1 {
5997 SELECT max(c) OVER win,
6001 WINDOW win AS ( ORDER BY a NULLS LAST GROUPS 6 PRECEDING EXCLUDE TIES )
6002 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
6003 } {223 223 1 239 239 1 309 309 1 572 572 1 627 627 1 870 870 1
6004 911 911 1 934 158 22 934 158 28 934 158 28 934 158 28 934 158 28
6005 934 158 28 934 158 28 934 223 9 934 223 9 934 223 9 934 223 9
6006 934 223 9 934 223 9 934 223 9 934 223 9 934 223 9 934 223 9
6007 934 223 9 934 223 9 934 223 9 934 223 22 934 223 22 934 223 22
6008 934 223 22 934 223 22 934 934 1 959 102 40 959 102 51 959 102 51
6009 959 102 51 959 102 51 959 102 51 959 102 51 959 102 51 959 102 51
6010 959 102 51 959 102 51 959 102 51 959 102 51 959 102 51 959 102 51
6011 959 102 51 959 113 35 959 113 40 959 113 40 959 113 40 959 113 40
6012 959 113 40 959 113 40 959 113 40 959 113 40 959 113 40 959 113 40
6013 959 158 28 959 158 35 959 158 35 959 158 35 959 158 35 963 102 51
6014 979 102 47 979 102 47 979 102 47 979 102 47 979 102 47 979 102 47
6015 979 102 47 979 102 48 979 102 48 979 102 48 979 102 48 979 102 48
6016 979 102 48 979 102 48 979 102 48 979 102 48 979 102 49 979 102 49
6017 979 102 49 979 102 49 979 102 49 979 102 49 979 102 51}
6019 do_execsql_test 5.4.11.2 {
6020 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
6022 dense_rank() OVER win
6024 WINDOW win AS ( ORDER BY a NULLS LAST GROUPS 6 PRECEDING EXCLUDE TIES )
6025 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
6026 } {{} 1 1 {} 1 1 {} 1 1 223 1 1 239 1 1 309 1 1 627 1 1 911 1 1
6027 2309 9 2 2309 9 2 2309 9 2 2309 9 2 2309 9 2 2309 9 2 2556 9 2
6028 2702 9 2 2702 9 2 2708 9 2 2942 9 2 3014 9 2 3020 9 2 5790 22 3
6029 5790 22 3 5790 22 3 5790 22 3 6397 22 3 6549 22 3 7156 28 4
6030 7156 28 4 7156 28 4 7156 28 4 7156 28 4 8001 28 4 8115 28 4
6031 8960 35 5 8960 35 5 9073 35 5 9589 35 5 9737 35 5 10028 68 9
6032 10028 68 9 10028 68 9 10396 59 8 10396 59 8 10396 59 8 10396 59 8
6033 10449 68 9 10471 68 9 10479 40 6 10479 40 6 10479 40 6 10479 40 6
6034 10479 40 6 10479 40 6 10479 40 6 10479 40 6 10479 40 6 10529 59 8
6035 10699 68 9 10751 59 8 10774 40 6 10833 68 9 11002 75 10
6036 11002 75 10 11002 75 10 11002 75 10 11079 59 8 11115 75 10
6037 11146 40 6 11259 75 10 11359 59 8 11375 59 8 11441 51 7
6038 11441 51 7 11441 51 7 11441 51 7 11441 51 7 11441 51 7 11776 51 7
6039 11841 75 10 11841 75 10 11901 75 10 12145 84 11 12145 84 11
6040 12370 51 7 12500 84 11 12544 84 11 12774 84 11 12812 84 11}
6042 do_execsql_test 5.4.12.1 {
6043 SELECT max(c) OVER win,
6047 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE TIES )
6048 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
6049 } {102 102 1 113 113 1 113 113 1 133 133 1 148 148 1 160 158 1
6050 160 158 2 160 158 2 208 208 1 224 223 2 224 223 2 239 234 3
6051 239 234 3 239 234 3 252 247 3 257 247 5 257 247 5 257 250 4
6052 257 252 3 295 295 1 309 309 1 336 330 3 336 330 3 336 330 3
6053 346 346 1 355 354 1 355 354 2 355 354 2 399 393 3 399 393 3
6054 399 393 3 399 393 4 399 393 4 412 412 1 421 421 1 430 430 1
6055 443 443 1 480 480 1 480 480 1 574 572 2 574 572 2 607 607 1
6056 618 618 1 618 618 1 634 627 3 634 627 4 634 627 4 634 627 4
6057 634 629 3 652 652 1 667 660 2 671 667 2 671 667 3 671 667 3
6058 671 667 3 683 683 1 711 705 2 716 705 3 716 711 2 730 726 2
6059 730 726 2 762 759 2 768 759 4 768 762 2 768 762 2 777 777 1
6060 792 786 3 794 786 4 794 786 4 794 790 3 805 805 1 822 822 1
6061 845 839 4 845 839 4 845 839 5 845 839 5 845 839 5 870 870 0
6062 870 870 1 870 870 1 899 899 1 911 911 1 934 929 2 938 929 4
6063 938 934 2 938 934 2 963 959 2 963 959 2 979 979 1}
6065 do_execsql_test 5.4.12.2 {
6066 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
6068 dense_rank() OVER win
6070 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING EXCLUDE TIES )
6071 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
6072 } {{} 1 1 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 25 23 {} 34 29
6073 {} 36 31 {} 38 33 {} 38 33 {} 40 34 {} 41 35 {} 43 37 {} 43 37
6074 {} 50 42 {} 60 51 {} 61 52 {} 64 55 {} 64 55 {} 67 57 {} 68 58
6075 {} 69 59 {} 70 60 {} 72 62 {} 78 67 {} 78 67 {} 78 67 {} 85 72
6076 {} 85 72 113 2 2 113 2 2 133 4 3 223 10 8 223 11 9 239 12 10
6077 239 13 11 239 14 12 247 15 13 257 18 16 257 19 17 295 20 18
6078 309 21 19 335 22 20 335 23 21 335 24 22 355 27 25 355 27 25
6079 421 35 30 443 37 32 504 16 14 504 17 15 607 42 36 683 56 47
6080 710 26 24 711 59 50 759 62 53 759 63 54 777 66 56 805 71 61
6081 899 81 68 911 82 69 929 83 70 929 84 71 979 89 75 1185 32 28
6082 1185 32 28 1191 29 26 1191 29 26 1334 51 43 1338 52 44 1338 52 44
6083 1416 57 48 1416 58 49 1584 31 27 1684 73 63 1684 73 63 1889 46 39
6084 1889 46 39 1891 49 41 1922 87 73 1922 88 74 2005 54 45 2005 55 46
6085 2518 45 38 2518 48 40 2523 75 64 2523 76 65 2523 77 66}
6087 do_execsql_test 5.4.13.1 {
6088 SELECT max(c) OVER win,
6092 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE TIES )
6093 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
6094 } {102 102 1 113 113 1 113 113 1 133 133 1 148 148 1 158 158 0
6095 158 158 1 160 160 1 208 208 1 223 223 1 224 224 1 234 234 1
6096 238 238 1 239 239 1 247 247 1 250 250 1 252 252 1 256 256 1
6097 257 257 1 295 295 1 309 309 1 330 330 1 335 335 1 336 336 1
6098 346 346 1 354 354 1 355 355 0 355 355 1 393 393 1 393 393 1
6099 398 398 1 399 399 0 399 399 1 412 412 1 421 421 1 430 430 1
6100 443 443 1 480 480 1 480 480 1 572 572 1 574 574 1 607 607 1
6101 618 618 1 618 618 1 627 627 1 629 629 0 629 629 1 633 633 1
6102 634 634 1 652 652 1 660 660 1 667 667 0 667 667 1 670 670 1
6103 671 671 1 683 683 1 705 705 1 711 711 1 716 716 1 726 726 1
6104 730 730 1 759 759 1 762 762 1 768 768 1 768 768 1 777 777 1
6105 786 786 1 790 790 1 792 792 1 794 794 1 805 805 1 822 822 1
6106 839 839 1 839 839 1 840 840 1 844 844 1 845 845 1 870 870 0
6107 870 870 1 870 870 1 899 899 1 911 911 1 929 929 1 934 934 1
6108 938 938 1 938 938 1 959 959 1 963 963 1 979 979 1}
6110 do_execsql_test 5.4.13.2 {
6111 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
6113 dense_rank() OVER win
6115 WINDOW win AS ( ORDER BY c NULLS LAST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING EXCLUDE TIES )
6116 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
6117 } {{} 1 1 {} 5 4 {} 6 5 {} 6 5 {} 8 6 {} 9 7 {} 11 9 {} 12 10
6118 {} 13 11 {} 16 14 {} 17 15 {} 18 16 {} 22 20 {} 24 22 {} 25 23
6119 {} 26 24 {} 31 27 {} 34 29 {} 36 31 {} 38 33 {} 38 33 {} 40 34
6120 {} 41 35 {} 43 37 {} 43 37 {} 49 41 {} 50 42 {} 51 43 {} 54 45
6121 {} 59 50 {} 60 51 {} 61 52 {} 63 54 {} 64 55 {} 64 55 {} 67 57
6122 {} 68 58 {} 69 59 {} 70 60 {} 72 62 {} 75 64 {} 76 65 {} 78 67
6123 {} 78 67 {} 78 67 {} 84 71 {} 85 72 {} 85 72 113 2 2 113 2 2
6124 133 4 3 223 10 8 239 14 12 247 15 13 257 19 17 295 20 18
6125 309 21 19 335 23 21 355 27 25 355 27 25 393 29 26 393 29 26
6126 399 32 28 399 32 28 421 35 30 443 37 32 607 42 36 627 45 38
6127 629 46 39 629 46 39 633 48 40 667 52 44 667 52 44 671 55 46
6128 683 56 47 705 57 48 711 58 49 759 62 53 777 66 56 805 71 61
6129 839 73 63 839 73 63 845 77 66 899 81 68 911 82 69 929 83 70
6130 959 87 73 963 88 74 979 89 75}
6132 do_execsql_test 5.4.14.1 {
6133 SELECT max(c) OVER win,
6137 WINDOW win AS ( ORDER BY c NULLS LAST, b NULLS LAST, a NULLS LAST
6138 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES )
6139 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
6140 } {979 102 83 979 102 83 979 102 83 979 102 83 979 102 83 979 102 83
6141 979 102 83 979 113 81 979 113 82 979 133 80 979 148 79 979 158 77
6142 979 158 78 979 160 77 979 208 76 979 223 75 979 224 74 979 234 73
6143 979 238 72 979 239 71 979 247 70 979 250 69 979 252 68 979 256 67
6144 979 257 66 979 295 65 979 309 64 979 330 63 979 335 62 979 336 61
6145 979 346 60 979 354 59 979 355 57 979 355 58 979 393 56 979 393 57
6146 979 398 55 979 399 53 979 399 54 979 412 53 979 421 52 979 430 51
6147 979 443 50 979 480 48 979 480 49 979 572 47 979 574 46 979 607 45
6148 979 618 43 979 618 44 979 627 42 979 629 40 979 629 41 979 633 40
6149 979 634 39 979 652 38 979 660 37 979 667 35 979 667 36 979 670 35
6150 979 671 34 979 683 33 979 705 32 979 711 31 979 716 30 979 726 29
6151 979 730 28 979 759 27 979 762 26 979 768 24 979 768 25 979 777 23
6152 979 786 22 979 790 21 979 792 20 979 794 19 979 805 18 979 822 17
6153 979 839 15 979 839 16 979 840 14 979 844 13 979 845 12 979 870 9
6154 979 870 10 979 870 11 979 899 9 979 911 8 979 929 7}
6156 do_execsql_test 5.4.14.2 {
6157 SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
6159 dense_rank() OVER win
6161 WINDOW win AS ( ORDER BY c NULLS LAST, b NULLS LAST, a NULLS LAST
6162 ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING EXCLUDE TIES )
6163 ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
6164 } {3830 89 89 4741 88 88 5640 84 84 5640 85 85 5640 86 86 5640 87 87
6165 6485 81 81 6485 82 82 6485 83 83 7324 80 80 8163 78 78 8163 79 79
6166 8968 73 73 8968 74 74 8968 75 75 8968 76 76 8968 77 77 9745 69 69
6167 9745 70 70 9745 71 71 9745 72 72 10504 65 65 10504 66 66
6168 10504 67 67 10504 68 68 11215 64 64 11920 63 63 12603 62 62
6169 13274 60 60 13274 61 61 13941 59 59 14608 55 55 14608 56 56
6170 14608 57 57 14608 58 58 15241 54 54 15870 53 53 16499 52 52
6171 17126 49 49 17126 50 50 17126 51 51 17733 44 44 17733 45 45
6172 17733 46 46 17733 47 47 17733 48 48 18176 42 42 18176 43 43
6173 18597 40 40 18597 41 41 18996 39 39 19395 37 37 19395 38 38
6174 19788 36 36 20181 35 35 20536 34 34 20891 30 30 20891 31 31
6175 20891 32 32 20891 33 33 21226 28 28 21226 29 29 21535 27 27
6176 21830 26 26 22087 22 22 22087 23 23 22087 24 24 22087 25 25
6177 22334 21 21 22573 17 17 22573 18 18 22573 19 19 22573 20 20
6178 22796 11 11 22796 12 12 22796 13 13 22796 14 14 22796 15 15
6179 22796 16 16 22929 10 10 23042 9 9 23155 1 1 23155 2 2 23155 3 3
6180 23155 4 4 23155 5 5 23155 6 6 23155 7 7 23155 8 8}
6182 #==========================================================================
6184 do_execsql_test 6.0 {
6185 DROP TABLE IF EXISTS t2;
6186 CREATE TABLE t2(a TEXT, b INTEGER);
6187 INSERT INTO t2 VALUES('A', NULL);
6188 INSERT INTO t2 VALUES('B', NULL);
6189 INSERT INTO t2 VALUES('C', 1);
6192 do_execsql_test 6.1 {
6193 SELECT group_concat(a, '.') OVER (
6194 ORDER BY b NULLS FIRST RANGE BETWEEN 7 PRECEDING AND 2 PRECEDING
6199 do_execsql_test 6.2 {
6200 SELECT group_concat(a, '.') OVER (
6201 ORDER BY b DESC NULLS LAST RANGE BETWEEN 7 PRECEDING AND 2 PRECEDING
6206 #==========================================================================
6208 do_execsql_test 7.0 {
6209 DROP TABLE IF EXISTS t2;
6210 CREATE TABLE t2(a INTEGER, b INTEGER);
6212 INSERT INTO t2 VALUES(1, 65);
6213 INSERT INTO t2 VALUES(2, NULL);
6214 INSERT INTO t2 VALUES(3, NULL);
6215 INSERT INTO t2 VALUES(4, NULL);
6216 INSERT INTO t2 VALUES(5, 66);
6217 INSERT INTO t2 VALUES(6, 67);
6220 do_execsql_test 7.1.1 {
6221 SELECT sum (a) OVER win FROM t2
6223 ORDER BY b NULLS LAST RANGE BETWEEN 6 FOLLOWING AND UNBOUNDED FOLLOWING
6227 do_execsql_test 7.1.2 {
6228 SELECT sum (a) OVER win FROM t2
6230 ORDER BY b NULLS LAST RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
6234 do_execsql_test 7.1.3 {
6235 SELECT sum (a) OVER win FROM t2
6237 ORDER BY b NULLS LAST RANGE BETWEEN 2 FOLLOWING AND 1 FOLLOWING
6241 do_execsql_test 7.1.4 {
6242 SELECT sum (a) OVER win FROM t2
6244 ORDER BY b NULLS FIRST RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
6248 do_execsql_test 7.1.5 {
6249 SELECT sum (a) OVER win FROM t2
6251 ORDER BY b NULLS FIRST RANGE BETWEEN 2 FOLLOWING AND 1 FOLLOWING
6255 do_execsql_test 7.1.6 {
6256 SELECT sum (a) OVER win FROM t2
6258 ORDER BY b NULLS LAST RANGE BETWEEN 1000 PRECEDING AND 2 PRECEDING
6262 do_execsql_test 7.1.7 {
6263 SELECT sum (a) OVER win FROM t2
6265 ORDER BY b NULLS LAST RANGE BETWEEN 2000 FOLLOWING AND 1000 FOLLOWING
6269 do_execsql_test 7.1.8 {
6270 SELECT sum (a) OVER win FROM t2
6272 ORDER BY b NULLS FIRST RANGE BETWEEN 1000 PRECEDING AND 2000 PRECEDING
6276 do_execsql_test 7.1.9 {
6277 SELECT sum (a) OVER win FROM t2
6279 ORDER BY b NULLS FIRST RANGE BETWEEN 2000 FOLLOWING AND 1000 FOLLOWING
6283 do_execsql_test 7.2.1 {
6284 SELECT min (a) OVER win FROM t2
6286 ORDER BY b NULLS LAST RANGE BETWEEN 6 FOLLOWING AND UNBOUNDED FOLLOWING
6290 do_execsql_test 7.2.2 {
6291 SELECT min (a) OVER win FROM t2
6293 ORDER BY b NULLS LAST RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
6297 do_execsql_test 7.2.3 {
6298 SELECT min (a) OVER win FROM t2
6300 ORDER BY b NULLS LAST RANGE BETWEEN 2 FOLLOWING AND 1 FOLLOWING
6304 do_execsql_test 7.2.4 {
6305 SELECT min (a) OVER win FROM t2
6307 ORDER BY b NULLS FIRST RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
6311 do_execsql_test 7.2.5 {
6312 SELECT min (a) OVER win FROM t2
6314 ORDER BY b NULLS FIRST RANGE BETWEEN 2 FOLLOWING AND 1 FOLLOWING
6318 do_execsql_test 7.2.6 {
6319 SELECT min (a) OVER win FROM t2
6321 ORDER BY b NULLS LAST RANGE BETWEEN 1000 PRECEDING AND 2 PRECEDING
6325 do_execsql_test 7.2.7 {
6326 SELECT min (a) OVER win FROM t2
6328 ORDER BY b NULLS LAST RANGE BETWEEN 2000 FOLLOWING AND 1000 FOLLOWING
6332 do_execsql_test 7.2.8 {
6333 SELECT min (a) OVER win FROM t2
6335 ORDER BY b NULLS FIRST RANGE BETWEEN 1000 PRECEDING AND 2000 PRECEDING
6339 do_execsql_test 7.2.9 {
6340 SELECT min (a) OVER win FROM t2
6342 ORDER BY b NULLS FIRST RANGE BETWEEN 2000 FOLLOWING AND 1000 FOLLOWING
6346 do_execsql_test 7.3.1 {
6347 SELECT sum (a) OVER win FROM t2
6349 ORDER BY b NULLS LAST RANGE BETWEEN 6 FOLLOWING AND UNBOUNDED FOLLOWING
6353 do_execsql_test 7.3.2 {
6354 SELECT sum (a) OVER win FROM t2
6356 ORDER BY b NULLS LAST RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
6360 do_execsql_test 7.3.3 {
6361 SELECT sum (a) OVER win FROM t2
6363 ORDER BY b NULLS LAST RANGE BETWEEN 2 FOLLOWING AND 1 FOLLOWING
6367 do_execsql_test 7.3.4 {
6368 SELECT sum (a) OVER win FROM t2
6370 ORDER BY b NULLS FIRST RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
6374 do_execsql_test 7.3.5 {
6375 SELECT sum (a) OVER win FROM t2
6377 ORDER BY b NULLS FIRST RANGE BETWEEN 2 FOLLOWING AND 1 FOLLOWING
6381 do_execsql_test 7.3.6 {
6382 SELECT sum (a) OVER win FROM t2
6384 ORDER BY b NULLS LAST RANGE BETWEEN 1000 PRECEDING AND 2 PRECEDING
6388 do_execsql_test 7.3.7 {
6389 SELECT sum (a) OVER win FROM t2
6391 ORDER BY b NULLS LAST RANGE BETWEEN 2000 FOLLOWING AND 1000 FOLLOWING
6395 do_execsql_test 7.3.8 {
6396 SELECT sum (a) OVER win FROM t2
6398 ORDER BY b NULLS FIRST RANGE BETWEEN 1000 PRECEDING AND 2000 PRECEDING
6402 do_execsql_test 7.3.9 {
6403 SELECT sum (a) OVER win FROM t2
6405 ORDER BY b NULLS FIRST RANGE BETWEEN 2000 FOLLOWING AND 1000 FOLLOWING
6409 do_execsql_test 7.4.1 {
6410 SELECT max (a) OVER win FROM t2
6412 ORDER BY b NULLS LAST RANGE BETWEEN 6 FOLLOWING AND UNBOUNDED FOLLOWING
6416 do_execsql_test 7.4.2 {
6417 SELECT max (a) OVER win FROM t2
6419 ORDER BY b NULLS LAST RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
6423 do_execsql_test 7.4.3 {
6424 SELECT max (a) OVER win FROM t2
6426 ORDER BY b NULLS LAST RANGE BETWEEN 2 FOLLOWING AND 1 FOLLOWING
6430 do_execsql_test 7.4.4 {
6431 SELECT max (a) OVER win FROM t2
6433 ORDER BY b NULLS FIRST RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
6437 do_execsql_test 7.4.5 {
6438 SELECT max (a) OVER win FROM t2
6440 ORDER BY b NULLS FIRST RANGE BETWEEN 2 FOLLOWING AND 1 FOLLOWING
6444 do_execsql_test 7.4.6 {
6445 SELECT max (a) OVER win FROM t2
6447 ORDER BY b NULLS LAST RANGE BETWEEN 1000 PRECEDING AND 2 PRECEDING
6451 do_execsql_test 7.4.7 {
6452 SELECT max (a) OVER win FROM t2
6454 ORDER BY b NULLS LAST RANGE BETWEEN 2000 FOLLOWING AND 1000 FOLLOWING
6458 do_execsql_test 7.4.8 {
6459 SELECT max (a) OVER win FROM t2
6461 ORDER BY b NULLS FIRST RANGE BETWEEN 1000 PRECEDING AND 2000 PRECEDING
6465 do_execsql_test 7.4.9 {
6466 SELECT max (a) OVER win FROM t2
6468 ORDER BY b NULLS FIRST RANGE BETWEEN 2000 FOLLOWING AND 1000 FOLLOWING
6472 #==========================================================================
6474 do_execsql_test 8.0 {
6475 DROP TABLE IF EXISTS tx;
6476 CREATE TABLE tx(a INTEGER PRIMARY KEY);
6477 INSERT INTO tx VALUES(1), (2), (3), (4), (5), (6);
6479 DROP TABLE IF EXISTS map;
6480 CREATE TABLE map(v INTEGER PRIMARY KEY, t TEXT);
6481 INSERT INTO map VALUES
6482 (1, 'odd'), (2, 'even'), (3, 'odd'),
6483 (4, 'even'), (5, 'odd'), (6, 'even');
6486 do_execsql_test 8.1 {
6487 SELECT sum(a) OVER (
6489 SELECT t FROM map WHERE v=a
6494 do_execsql_test 8.2 {
6495 SELECT sum(a) OVER win FROM tx
6498 SELECT t FROM map WHERE v=a
6503 do_execsql_test 8.3 {
6507 SELECT sum(a) OVER (
6509 SELECT t FROM map2 WHERE v=a
6514 do_execsql_test 8.4 {
6518 SELECT sum(a) OVER win FROM tx
6521 SELECT t FROM map2 WHERE v=a
6526 #==========================================================================
6528 do_execsql_test 9.1 {
6529 DROP TABLE IF EXISTS t1;
6530 DROP TABLE IF EXISTS t2;
6531 CREATE TABLE t1(a INTEGER);
6532 CREATE TABLE t2(y INTEGER);
6535 do_execsql_test 9.2 {
6537 SELECT max(a) OVER ( ORDER BY (SELECT sum(a) FROM t1) )