sqlite/test/window3.test

9055 lines
4.3 MiB
Plaintext
Raw Normal View History

# 2018 May 31
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
####################################################
# DO NOT EDIT! THIS FILE IS AUTOMATICALLY GENERATED!
####################################################
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix window3
ifcapable !windowfunc { finish_test ; return }
do_execsql_test 1.0 {
DROP TABLE IF EXISTS t2;
CREATE TABLE t2(a INTEGER PRIMARY KEY, b INTEGER);
INSERT INTO t2(a, b) VALUES
(1,0), (2,74), (3,41), (4,74), (5,23), (6,99), (7,26), (8,33), (9,2),
(10,89), (11,81), (12,96), (13,59), (14,38), (15,68), (16,39), (17,62),
(18,91), (19,46), (20,6), (21,99), (22,97), (23,27), (24,46), (25,78),
(26,54), (27,97), (28,8), (29,67), (30,29), (31,93), (32,84), (33,77),
(34,23), (35,16), (36,16), (37,93), (38,65), (39,35), (40,47), (41,7),
(42,86), (43,74), (44,61), (45,91), (46,85), (47,24), (48,85), (49,43),
(50,59), (51,12), (52,32), (53,56), (54,3), (55,91), (56,22), (57,90),
(58,55), (59,15), (60,28), (61,89), (62,25), (63,47), (64,1), (65,56),
(66,40), (67,43), (68,56), (69,16), (70,75), (71,36), (72,89), (73,98),
(74,76), (75,81), (76,4), (77,94), (78,42), (79,30), (80,78), (81,33),
(82,29), (83,53), (84,63), (85,2), (86,87), (87,37), (88,80), (89,84),
(90,72), (91,41), (92,9), (93,61), (94,73), (95,95), (96,65), (97,13),
(98,58), (99,96), (100,98), (101,1), (102,21), (103,74), (104,65), (105,35),
(106,5), (107,73), (108,11), (109,51), (110,87), (111,41), (112,12), (113,8),
(114,20), (115,31), (116,31), (117,15), (118,95), (119,22), (120,73),
(121,79), (122,88), (123,34), (124,8), (125,11), (126,49), (127,34),
(128,90), (129,59), (130,96), (131,60), (132,55), (133,75), (134,77),
(135,44), (136,2), (137,7), (138,85), (139,57), (140,74), (141,29), (142,70),
(143,59), (144,19), (145,39), (146,26), (147,26), (148,47), (149,80),
(150,90), (151,36), (152,58), (153,47), (154,9), (155,72), (156,72), (157,66),
(158,33), (159,93), (160,75), (161,64), (162,81), (163,9), (164,23), (165,37),
(166,13), (167,12), (168,14), (169,62), (170,91), (171,36), (172,91),
(173,33), (174,15), (175,34), (176,36), (177,99), (178,3), (179,95), (180,69),
(181,58), (182,52), (183,30), (184,50), (185,84), (186,10), (187,84),
(188,33), (189,21), (190,39), (191,44), (192,58), (193,30), (194,38),
(195,34), (196,83), (197,27), (198,82), (199,17), (200,7), (201,5);
} {}
do_execsql_test 1.1 {
SELECT max(b) OVER (
ORDER BY a
) FROM t2
} {0 74 74 74 74 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.1.2.1 {
SELECT max(b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 74 74 74 74 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.1.2.2 {
SELECT min(b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.1.3.1 {
SELECT row_number() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.1.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.1.3.3 {
SELECT row_number() OVER ( RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.1.4.1 {
SELECT dense_rank() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.1.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.1.4.3 {
SELECT dense_rank() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.1.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.1.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.1.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.1.5.1 {
SELECT rank() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.1.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.1.5.3 {
SELECT rank() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.1.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.1.5.5 {
SELECT rank() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.1.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.1.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.1.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.1.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.1.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 76 44 78 28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206}
do_execsql_test 1.1.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.1.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 65 102 11 87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276}
do_execsql_test 1.1.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 196 134 109 213 223 106 234 191 212 168 229 147 218 240 65 102 119 136 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 11 87 138 63 124 179 78 141 84 120 234 79 231 162 227 228 280 57 181 110 179 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 80 182 71 157 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 111 206 74 132 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 26 51 52 85 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 48 144 207 216 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 36 121 132 88 52 232 156 210 239 250 83 103 158 210 171 198 101 163 172 163 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276}
do_execsql_test 1.1.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.1.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.1.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} 41 {} {} {} {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} 2 {} 29 {} {} {} 46 62 62 {} {} 16 {} 33 {} {} {} {} {} 78 {} 61 {} 59 77 {} 74 {} 27 {} 22 39 67 {} 54 85 74 90 7 61 90 62 {} 93 {} {} {} {} 23 {} 74 93 30 23 29 3 1 41 {} 65 33 2 98 86 89 25 76 {} 40 38 15 13 96 74 97 81 40 16 99 76 96 32 80 86 59 2 99 84 84 39 65 27 76 78 84 16 2 96 59 16 41 28 13 89 22 4 42 91 41 33 87 55 81 29 36 28 6 47 97 97 85 33 41 93 15 85 89 98 98 43 23 73 4 56 29 89 46 65 38 59 68 47 9 93 9 23 39 16 93 98 74 65 75 15 56 93 12 2 81 2 23 97 47 91 15 93 35 16 63 8 53 91 33 99}
do_execsql_test 1.1.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} 81 {} {} {} 81 {} 21 {} {} {} {} 21 {} {} {} 21 {} {} {} {} {} {} 12 {} {} {} 12 {} {} 72 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 73 {} 23 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} 64 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 15 {} {} {} {} {} {} 55 {} 15 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 47 {} {} {} {} {} {} {} {} {} 98 {} 98 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 29 {} {} {} {} {} {} {} 29 29 {} {} {}}
do_execsql_test 1.1.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 4 4 5 5 5 5 6 6 7 7 7 7 7 7 8 8 8 8 8 8 8 9 9 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 17 17 17 17 19 19 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 25 25 25 25 26 26 27 27 28 29 29 29 29 29 29 30 30 30 30 30 30 30 30 30 31 31 31 32 32 33 33 33 33 33 33 33 34 34 34 35 35 35 35 35 35 36 36 36 36 36 36 36 36 36 36 36 37 37 37 38 38 38 38 38 39 39 39 39 39 39 40 40 40 41 41 41 41 42 42 42 43 43 43 43 43 43 43 43 44 44 44 46 46 46 46 47 47 47 47 47 47 47 47 47 47}
do_execsql_test 1.1.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} 90 {} {} {} 90 1 30 {} {} {} 31 30 {} {} {} 1 40 {} 50 11 81 42 40 {} 50 81 40 {} {} 50 {} 52 {} 41 81 {} 41 {} 2 30 2 81 82 53 {} 10 {} {} 81 {} 41 10 81 30 81 {} 3 3 23 {} 3 61 80 {} 94 3 91 91 72 3 63 30 91 94 94 72 91 73 91 84 84 33 41 1 33 84 73 73 91 20 41 84 33 33 84 33 41 84 20 21 44 22 90 22 81 81 74 93 93 93 81 21 83 44 44 21 21 21 13 21 21 34 11 34 73 74 2 60 2 34 2 34 74 60 23 2 2 2 11 91 60 62 73 74 70 51 65 74 93 65 70 34 70 93 93 93 62 35 44 43 12 35 41 43 44 44 41 80 54 72 43 41 43 91 12 80 80 35 33 12}
do_execsql_test 1.1.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.11.1 {
SELECT first_value(b) OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.1.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.1.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.1.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9}
do_execsql_test 1.1.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.1.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.1.12.1 {
SELECT lead(b,b) OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.13.1 {
SELECT lag(b,b) OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.1.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.1.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.1.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.1.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.1.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 0.74 0.74.41 0.74.41.74 0.74.41.74.23 0.74.41.74.23.99 0.74.41.74.23.99.26 0.74.41.74.23.99.26.33 0.74.41.74.23.99.26.33.2 0.74.41.74.23.99.26.33.2.89 0.74.41.74.23.99.26.33.2.89.81 0.74.41.74.23.99.26.33.2.89.81.96 0.74.41.74.23.99.26.33.2.89.81.96.59 0.74.41.74.23.99.26.33.2.89.81.96.59.38 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32 0.74.41.74.23.99.26.
do_execsql_test 1.1.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 0.90 0.90.40 0.90.40.30 0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 0.90.40.30.80.20.90.60 0.90.40.30.80.20.90.60.70 0.90.40.30.80.20.90.60.70.80 0.90.40.30.80.20.90.60.70.80.90 0.90.40.30.80.20.90.60.70.80.90.30 0.90.40.30.80.20.90.60.70.80.90.30.50 0.90.40.30.80.20.90.60.70.80.90.30.50.10 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 41 41.81 41.81.91 41.81.91.61 41.81.91.61.91 41.81.91.61.91.91 41.81.91.61.91.91.1 41.81.91.61.91.91.1.81 41.81.91.61.91.91.1.81.41 41.81.91.61.91.91.1.81.41.61 41.81.91.61.91.91.1.81.41.61.1 41.81.91.61.91.91.1.81.41.61.1.21 41.81.91.61.91.91.1.81.41.61.1.21.11 41.81.91.61.91.91.1.81.41.61.1.21.11.51 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 2 2.62 2.62.12 2.62.12.32 2.62.12.32.22 2.62.12.32.22.42 2.62.12.32.22.42.2 2.62.12.32.22.42.2.72 2.62.12.32.22.42.2.72.12 2.62.12.32.22.42.2.72.12.22 2.62.12.32.22.42.2.72.12.22.2 2.62.12.32.22.42.2.72.12.22.2.72 2.62.12.32.22.42.2.72.12.22.2.72.72 2.62.12.32.22.42.2.72.12.22.2.72.72.12 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 23 23.33 23.33.93 23.33.93.23 23.33.93.23.93 23.33.93.23.93.43 23.33.93.23.93.43.3 23.33.93.23.93.43.3.43 23.33.93.23.93.43.3.43.33 23.33.93.23.93.43.3.43.33.53 23.33.93.23.93.43.3.43.33.53.63 23.33.93.23.93.43.3.43.33.53.63.73 23.33.93.23.93.43.3.43.33.53.63.73.13 23.33.93.23.93.43.3.43.33.53.63.73.13.73 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 74 74.74 74.74.54 74.74.54.84 74.74.54.84.74 74.74.54.84.74.24 74.74.54.84.74.24.4 74.74.54.84.74.24.4.94 74.74.54.84.74.24.4.94.84 74.74.54.84.74.24.4.94.84.74 74.74.54.84.74.24.4.94.84.74.34 74.74.54.84.74.24.4.94.84.74.34.34 74.74.54.84.74.24.4.94.84.74.34.34.44 74.74.54.84.74.24.4.94.84.74.34.34.44.74 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 65 65.35 65.35.85 65.35.85.85 65.35.85.85.55 65.35.85.85.55.15 65.35.85.85.55.15.25 65.35.85.85.55.15.25.75 65.35.85.85.55.15.25.75.95 65.35.85.85.55.15.25.75.95.65 65.35.85.85.55.15.25.75.95.65.65 65.35.85.85.55.15.25.75.95.65.65.35 65.35.85.85.55.15.25.75.95.65.65.35.5 65.35.85.85.55.15.25.75.95.65.65.35.5.15 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 26 26.96 26.96.46 26.96.46.6 26.96.46.6.46 26.96.46.6.46.16 26.96.46.6.46.16.16 26.96.46.6.46.16.16.86
do_execsql_test 1.1.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.1 0.1.1 0.1.1.2 0.1.1.2.2 0.1.1.2.2.2 0.1.1.2.2.2.3 0.1.1.2.2.2.3.3 0.1.1.2.2.2.3.3.4 0.1.1.2.2.2.3.3.4.5 0.1.1.2.2.2.3.3.4.5.5 0.1.1.2.2.2.3.3.4.5.5.6 0.1.1.2.2.2.3.3.4.5.5.6.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29 0.1.1.
do_execsql_test 1.1.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.10 0.10.20 0.10.20.30 0.10.20.30.30 0.10.20.30.30.30 0.10.20.30.30.30.40 0.10.20.30.30.30.40.50 0.10.20.30.30.30.40.50.60 0.10.20.30.30.30.40.50.60.70 0.10.20.30.30.30.40.50.60.70.80 0.10.20.30.30.30.40.50.60.70.80.80 0.10.20.30.30.30.40.50.60.70.80.80.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 1 1.1 1.1.11 1.1.11.11 1.1.11.11.21 1.1.11.11.21.21 1.1.11.11.21.21.31 1.1.11.11.21.21.31.31 1.1.11.11.21.21.31.31.41 1.1.11.11.21.21.31.31.41.41 1.1.11.11.21.21.31.31.41.41.41 1.1.11.11.21.21.31.31.41.41.41.51 1.1.11.11.21.21.31.31.41.41.41.51.61 1.1.11.11.21.21.31.31.41.41.41.51.61.61 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 2 2.2 2.2.2 2.2.2.12 2.2.2.12.12 2.2.2.12.12.12 2.2.2.12.12.12.22 2.2.2.12.12.12.22.22 2.2.2.12.12.12.22.22.32 2.2.2.12.12.12.22.22.32.42 2.2.2.12.12.12.22.22.32.42.52 2.2.2.12.12.12.22.22.32.42.52.62 2.2.2.12.12.12.22.22.32.42.52.62.62 2.2.2.12.12.12.22.22.32.42.52.62.62.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 3 3.3 3.3.13 3.3.13.13 3.3.13.13.23 3.3.13.13.23.23 3.3.13.13.23.23.23 3.3.13.13.23.23.23.33 3.3.13.13.23.23.23.33.33 3.3.13.13.23.23.23.33.33.33 3.3.13.13.23.23.23.33.33.33.33 3.3.13.13.23.23.23.33.33.33.33.33 3.3.13.13.23.23.23.33.33.33.33.33.43 3.3.13.13.23.23.23.33.33.33.33.33.43.43 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 4 4.14 4.14.24 4.14.24.34 4.14.24.34.34 4.14.24.34.34.34 4.14.24.34.34.34.34 4.14.24.34.34.34.34.44 4.14.24.34.34.34.34.44.44 4.14.24.34.34.34.34.44.44.54 4.14.24.34.34.34.34.44.44.54.64 4.14.24.34.34.34.34.44.44.54.64.74 4.14.24.34.34.34.34.44.44.54.64.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 5 5.5 5.5.15 5.5.15.15 5.5.15.15.15 5.5.15.15.15.25 5.5.15.15.15.25.35 5.5.15.15.15.25.35.35 5.5.15.15.15.25.35.35.55 5.5.15.15.15.25.35.35.55.55 5.5.15.15.15.25.35.35.55.55.65 5.5.15.15.15.25.35.35.55.55.65.65 5.5.15.15.15.25.35.35.55.55.65.65.65 5.5.15.15.15.25.35.35.55.55.65.65.65.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 6 6.16 6.16.16 6.16.16.16 6.16.16.16.26 6.16.16.16.26.26 6.16.16.16.26.26.26 6.16.16.16.26.26.26.36 6.16.16.16.26.26.26.36.36 6.16.16.16.26.26.26.36.36.36 6.16.16.16.26.26.26.36.36.36.36
do_execsql_test 1.1.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.90 0.90.40 0.90.40.30 0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 0.90.40.30.80.20.90.60 0.90.40.30.80.20.90.60.70 0.90.40.30.80.20.90.60.70.80 0.90.40.30.80.20.90.60.70.80.90 0.90.40.30.80.20.90.60.70.80.90.30 0.90.40.30.80.20.90.60.70.80.90.30.50 0.90.40.30.80.20.90.60.70.80.90.30.50.10 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.1
do_execsql_test 1.1.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.1.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
} {1 {} 2 74 3 74 4 74.74 5 74.74 6 74.74.99 7 74.74.99 8 74.74.99.33 9 74.74.99.33 10 74.74.99.33.89 11 74.74.99.33.89 12 74.74.99.33.89.96 13 74.74.99.33.89.96 14 74.74.99.33.89.96.38 15 74.74.99.33.89.96.38 16 74.74.99.33.89.96.38.39 17 74.74.99.33.89.96.38.39 18 74.74.99.33.89.96.38.39.91 19 74.74.99.33.89.96.38.39.91 20 74.74.99.33.89.96.38.39.91.6 21 74.74.99.33.89.96.38.39.91.6 22 74.74.99.33.89.96.38.39.91.6.97 23 74.74.99.33.89.96.38.39.91.6.97 24 74.74.99.33.89.96.38.39.91.6.97.46 25 74.74.99.33.89.96.38.39.91.6.97.46 26 74.74.99.33.89.96.38.39.91.6.97.46.54 27 74.74.99.33.89.96.38.39.91.6.97.46.54 28 74.74.99.33.89.96.38.39.91.6.97.46.54.8 29 74.74.99.33.89.96.38.39.91.6.97.46.54.8 30 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29 31 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29 32 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84 33 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84 34 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23 35 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23 36 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16 37 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16 38 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65 39 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65 40 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47 41 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47 42 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86 43 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86 44 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61 45 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61 46 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85 47 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85 48 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85 49 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85 50 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59 51 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59 52 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32 53 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32 54 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3 55 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3 56 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22 57 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22 58 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55 59 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55 60 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28 61 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28 62 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25 63 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25 64 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1 65 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1 66 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40 67 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40 68 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56 69 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56 70 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75 71 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75 72 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.5
do_execsql_test 1.1.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
} {1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 22 {} 23 {} 24 {} 25 {} 26 {} 27 {} 28 {} 29 {} 30 {} 31 {} 32 {} 33 {} 34 {} 35 {} 36 {} 37 {} 38 {} 39 {} 40 {} 41 {} 42 {} 43 {} 44 {} 45 {} 46 {} 47 {} 48 {} 49 {} 50 {} 51 {} 52 {} 53 {} 54 {} 55 {} 56 {} 57 {} 58 {} 59 {} 60 {} 61 {} 62 {} 63 {} 64 {} 65 {} 66 {} 67 {} 68 {} 69 {} 70 {} 71 {} 72 {} 73 {} 74 {} 75 {} 76 {} 77 {} 78 {} 79 {} 80 {} 81 {} 82 {} 83 {} 84 {} 85 {} 86 {} 87 {} 88 {} 89 {} 90 {} 91 {} 92 {} 93 {} 94 {} 95 {} 96 {} 97 {} 98 {} 99 {} 100 {} 101 {} 102 {} 103 {} 104 {} 105 {} 106 {} 107 {} 108 {} 109 {} 110 {} 111 {} 112 {} 113 {} 114 {} 115 {} 116 {} 117 {} 118 {} 119 {} 120 {} 121 {} 122 {} 123 {} 124 {} 125 {} 126 {} 127 {} 128 {} 129 {} 130 {} 131 {} 132 {} 133 {} 134 {} 135 {} 136 {} 137 {} 138 {} 139 {} 140 {} 141 {} 142 {} 143 {} 144 {} 145 {} 146 {} 147 {} 148 {} 149 {} 150 {} 151 {} 152 {} 153 {} 154 {} 155 {} 156 {} 157 {} 158 {} 159 {} 160 {} 161 {} 162 {} 163 {} 164 {} 165 {} 166 {} 167 {} 168 {} 169 {} 170 {} 171 {} 172 {} 173 {} 174 {} 175 {} 176 {} 177 {} 178 {} 179 {} 180 {} 181 {} 182 {} 183 {} 184 {} 185 {} 186 {} 187 {} 188 {} 189 {} 190 {} 191 {} 192 {} 193 {} 194 {} 195 {} 196 {} 197 {} 198 {} 199 {} 200 {} 201 {}}
do_execsql_test 1.1.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
} {1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {}}
do_execsql_test 1.1.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
} {1 89 2 89.6 3 89.6.29 4 89.6.29.47 5 89.6.29.47.59 6 89.6.29.47.59.28 7 89.6.29.47.59.28.75 8 89.6.29.47.59.28.75.78 9 89.6.29.47.59.28.75.78.72 10 89.6.29.47.59.28.75.78.72.98 11 89.6.29.47.59.28.75.78.72.98.87 12 89.6.29.47.59.28.75.78.72.98.87.73 13 89.6.29.47.59.28.75.78.72.98.87.73.96 14 89.6.29.47.59.28.75.78.72.98.87.73.96.74 15 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90 16 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75 17 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91 18 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69 19 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 1 74 2 74.96 3 74.96.97 4 74.96.97.84 5 74.96.97.84.86 6 74.96.97.84.86.32 7 74.96.97.84.86.32.25 8 74.96.97.84.86.32.25.89 9 74.96.97.84.86.32.25.89.29 10 74.96.97.84.86.32.25.89.29.9 11 74.96.97.84.86.32.25.89.29.9.21 12 74.96.97.84.86.32.25.89.29.9.21.12 13 74.96.97.84.86.32.25.89.29.9.21.12.88 14 74.96.97.84.86.32.25.89.29.9.21.12.88.55 15 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70 16 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58 17 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81 18 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91 19 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 74 2 74.38 3 74.38.46 4 74.38.46.23 5 74.38.46.23.61 6 74.38.46.23.61.3 7 74.38.46.23.61.3.1 8 74.38.46.23.61.3.1.76 9 74.38.46.23.61.3.1.76.63 10 74.38.46.23.61.3.1.76.63.73 11 74.38.46.23.61.3.1.76.63.73.65 12 74.38.46.23.61.3.1.76.63.73.65.20 13 74.38.46.23.61.3.1.76.63.73.65.20.8 14 74.38.46.23.61.3.1.76.63.73.65.20.8.77 15 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19 16 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9 17 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23 18 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15 19 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 99 2 99.39 3 99.39.54 4 99.39.54.16 5 99.39.54.16.85 6 99.39.54.16.85.22 7 99.39.54.16.85.22.40 8 99.39.54.16.85.22.40.4 9 99.39.54.16.85.22.40.4.87 10 99.39.54.16.85.22.40.4.87.65 11 99.39.54.16.85.22.40.4.87.65.5 12 99.39.54.16.85.22.40.4.87.65.5.31 13 99.39.54.16.85.22.40.4.87.65.5.31.49 14 99.39.54.16.85.22.40.4.87.65.5.31.49.2 15 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26 16 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72 17 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13 18 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36 19 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 33 2 33.91 3 33.91.8 4 33.91.8.65 5 33.91.8.65.85 6 33.91.8.65.85.55 7 33.91.8.65.85.55.56 8 33.91.8.65.85.55.56.42 9 33.91.8.65.85.55.56.42.80 10 33.91.8.65.85.55.56.42.80.58 11 33.91.8.65.85.55.56.42.80.58.11 12 33.91.8.65.85.55.56.42.80.58.11.95 13 33.91.8.65.85.55.56.42.80.58.11.95.90 14 33.91.8.65.85.55.56.42.80.58.11.95.90.85 15 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47 16 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33 17 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14 18 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3 19 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33 20 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82
do_execsql_test 1.2.2.1 {
SELECT max(b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.2.2.2 {
SELECT min(b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.2.3.1 {
SELECT row_number() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.2.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.2.3.3 {
SELECT row_number() OVER ( RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.2.4.1 {
SELECT dense_rank() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.2.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.2.4.3 {
SELECT dense_rank() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.2.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.2.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.2.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.2.5.1 {
SELECT rank() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.2.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.2.5.3 {
SELECT rank() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.2.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.2.5.5 {
SELECT rank() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.2.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.2.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.2.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.2.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.2.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206}
do_execsql_test 1.2.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.2.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.2.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.2.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.2.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.2.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 81 86 81 46 98 97 23 41 72 29 13 28 35 16 47 47 9 24 26 98 58 8 24 30 91 58 2 56 29 73 2 42 46 62 62 73 40 16 85 33 37 81 25 9 87 78 87 61 28 59 77 90 74 9 27 41 22 39 67 72 54 85 74 90 7 61 90 62 4 93 72 96 94 29 23 95 74 93 30 23 29 3 1 41 80 65 33 2 98 86 89 25 76 65 40 38 15 13 96 74 97 81 40 16 99 76 96 32 80 86 59 2 99 84 84 39 65 27 76 78 84 16 2 96 59 16 41 28 13 89 22 4 42 91 41 33 87 55 81 29 36 28 6 47 97 97 85 33 41 93 15 85 89 98 98 43 23 73 4 56 29 89 46 65 38 59 68 47 9 93 9 23 39 16 93 98 74 65 75 15 56 93 12 2 81 2 23 97 47 91 15 93 35 16 63 8 53 91 33 99}
do_execsql_test 1.2.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} 81 {} {} {} 81 21 21 {} {} {} {} 21 {} {} {} 21 12 {} 72 {} {} {} 12 {} 72 {} 12 {} {} 72 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} 73 {} {} {} {} {} 73 {} 23 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} 64 {} {} {} {} {} {} {} {} {} {} 55 {} {} {} {} {} {} 15 55 {} {} {} {} {} 55 {} 15 {} {} {} 16 {} 26 26 {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 47 {} {} {} {} {} 27 47 {} {} {} 98 {} {} {} {} {} 98 {} 98 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 29 {} {} {} {} {} 9 {} 29 29 {} {} {}}
do_execsql_test 1.2.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 4 4 5 5 5 5 6 6 7 7 7 7 7 7 8 8 8 8 8 8 8 9 9 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 17 17 17 17 19 19 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 25 25 25 25 26 26 27 27 28 29 29 29 29 29 29 30 30 30 30 30 30 30 30 30 31 31 31 32 32 33 33 33 33 33 33 33 34 34 34 35 35 35 35 35 35 36 36 36 36 36 36 36 36 36 36 36 37 37 37 38 38 38 38 38 39 39 39 39 39 39 40 40 40 41 41 41 41 42 42 42 43 43 43 43 43 43 43 43 44 44 44 46 46 46 46 47 47 47 47 47 47 47 47 47 47}
do_execsql_test 1.2.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 1 51 51 91 91 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 2 2 62 62 62 {} {} {} {} {} {} {} {} {} {} {} 13 13 43 43 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 25 75 75 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 66 66 66 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 37 37 87 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 58 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 39 39 89 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 74 32 31 84 91 74 3 93 84 74 31 12 90 31 22 74 64 43 64 64 90 74 22 43 90 1 30 62 22 31 31 30 74 64 64 1 40 33 50 11 81 42 40 13 50 81 40 13 13 50 33 52 24 41 81 34 41 34 2 30 2 81 82 53 33 10 33 33 81 34 41 10 81 30 81 4 3 3 23 94 3 61 80 84 94 3 91 91 72 3 63 30 91 94 94 72 91 73 91 84 84 33 41 1 33 84 73 73 91 20 41 84 33 33 84 33 41 84 20 21 44 22 90 22 81 81 74 93 93 93 81 21 83 44 44 21 21 21 13 21 21 34 11 34 73 74 2 60 2 34 2 34 74 60 23 2 2 2 11 91 60 62 73 74 70 51 65 74 93 65 70 34 70 93 93 93 62 35 44 43 12 35 41 43 44 44 41 80 54 72 43 41 43 91 12 80 80 35 33 12}
do_execsql_test 1.2.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.11.1 {
SELECT first_value(b) OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.2.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.2.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.2.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9}
do_execsql_test 1.2.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.2.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.2.12.1 {
SELECT lead(b,b) OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.13.1 {
SELECT lag(b,b) OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.2.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.2.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.2.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.2.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.2.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74
do_execsql_test 1.2.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.8
do_execsql_test 1.2.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.
do_execsql_test 1.2.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.9
do_execsql_test 1.2.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90
do_execsql_test 1.2.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.2.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
} {201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.1
do_execsql_test 1.2.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
} {201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {}}
do_execsql_test 1.2.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
} {20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {}}
do_execsql_test 1.2.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
} {20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 {
do_execsql_test 1.3.2.1 {
SELECT max(b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.3.2.2 {
SELECT min(b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.3.3.1 {
SELECT row_number() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.3.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.3.3.3 {
SELECT row_number() OVER ( RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.3.4.1 {
SELECT dense_rank() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.3.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.3.4.3 {
SELECT dense_rank() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.3.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.3.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.3.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.3.5.1 {
SELECT rank() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.3.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.3.5.3 {
SELECT rank() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.3.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.3.5.5 {
SELECT rank() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.3.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.3.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.3.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.3.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.3.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 76 44 78 28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206}
do_execsql_test 1.3.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.3.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 65 102 11 87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276}
do_execsql_test 1.3.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 196 134 109 213 223 106 234 191 212 168 229 147 218 240 65 102 119 136 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 11 87 138 63 124 179 78 141 84 120 234 79 231 162 227 228 280 57 181 110 179 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 80 182 71 157 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 111 206 74 132 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 26 51 52 85 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 48 144 207 216 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 36 121 132 88 52 232 156 210 239 250 83 103 158 210 171 198 101 163 172 163 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276}
do_execsql_test 1.3.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.3.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.3.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.11.1 {
SELECT first_value(b) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.3.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.3.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99}
do_execsql_test 1.3.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 10 20 30 30 30 40 50 60 70 80 80 90 90 90 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 2 2 2 12 12 12 22 22 32 42 52 62 62 72 72 72 82 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 8 8 8 28 38 38 58 58 58 58 68 78 78 88 98 98 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99}
do_execsql_test 1.3.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.3.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.3.12.1 {
SELECT lead(b,b) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.13.1 {
SELECT lag(b,b) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.3.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.3.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.3.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.3.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.3.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.3.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.3.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99}
do_execsql_test 1.3.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 10 20 30 30 30 40 50 60 70 80 80 90 90 90 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 2 2 2 12 12 12 22 22 32 42 52 62 62 72 72 72 82 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 8 8 8 28 38 38 58 58 58 58 68 78 78 88 98 98 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99}
do_execsql_test 1.3.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.3.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.3.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW)
} {1 {} 1 74 1 {} 1 74 1 {} 1 99 1 {} 1 33 1 {} 1 89 1 {} 1 96 1 {} 1 38 1 {} 1 39 1 {} 1 91 1 {} 1 6 1 {} 1 97 1 {} 1 46 1 {} 1 54 1 {} 1 8 1 {} 1 29 1 {} 1 84 1 {} 1 23 1 {} 1 16 1 {} 1 65 1 {} 1 47 1 {} 1 86 1 {} 1 61 1 {} 1 85 1 {} 1 85 1 {} 1 59 1 {} 1 32 1 {} 1 3 1 {} 1 22 1 {} 1 55 1 {} 1 28 1 {} 1 25 1 {} 1 1 1 {} 1 40 1 {} 1 56 1 {} 1 75 1 {} 1 89 1 {} 1 76 1 {} 1 4 1 {} 1 42 1 {} 1 78 1 {} 1 29 1 {} 1 63 1 {} 1 87 1 {} 1 80 1 {} 1 72 1 {} 1 9 1 {} 1 73 1 {} 1 65 1 {} 1 58 1 {} 1 98 1 {} 1 21 1 {} 1 65 1 {} 1 5 1 {} 1 11 1 {} 1 87 1 {} 1 12 1 {} 1 20 1 {} 1 31 1 {} 1 95 1 {} 1 73 1 {} 1 88 1 {} 1 8 1 {} 1 49 1 {} 1 90 1 {} 1 96 1 {} 1 55 1 {} 1 77 1 {} 1 2 1 {} 1 85 1 {} 1 74 1 {} 1 70 1 {} 1 19 1 {} 1 26 1 {} 1 47 1 {} 1 90 1 {} 1 58 1 {} 1 9 1 {} 1 72 1 {} 1 33 1 {} 1 75 1 {} 1 81 1 {} 1 23 1 {} 1 13 1 {} 1 14 1 {} 1 91 1 {} 1 91 1 {} 1 15 1 {} 1 36 1 {} 1 3 1 {} 1 69 1 {} 1 52 1 {} 1 50 1 {} 1 10 1 {} 1 33 1 {} 1 39 1 {} 1 58 1 {} 1 38 1 {} 1 83 1 {} 1 82 1 {} 1 7 1 {}}
do_execsql_test 1.3.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW)
} {1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {}}
do_execsql_test 1.3.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW)
} {1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {}}
do_execsql_test 1.3.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a RANGE BETWEEN CURRENT ROW AND CURRENT ROW)
} {1 89 1 6 1 29 1 47 1 59 1 28 1 75 1 78 1 72 1 98 1 87 1 73 1 96 1 74 1 90 1 75 1 91 1 69 1 39 1 7 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 74 1 96 1 97 1 84 1 86 1 32 1 25 1 89 1 29 1 9 1 21 1 12 1 88 1 55 1 70 1 58 1 81 1 91 1 52 1 58 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 74 1 38 1 46 1 23 1 61 1 3 1 1 1 76 1 63 1 73 1 65 1 20 1 8 1 77 1 19 1 9 1 23 1 15 1 50 1 38 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 99 1 39 1 54 1 16 1 85 1 22 1 40 1 4 1 87 1 65 1 5 1 31 1 49 1 2 1 26 1 72 1 13 1 36 1 10 1 83 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 33 1 91 1 8 1 65 1 85 1 55 1 56 1 42 1 80 1 58 1 11 1 95 1 90 1 85 1 47 1 33 1 14 1 3 1 33 1 82 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {}}
do_execsql_test 1.4.2.1 {
SELECT max(b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 95 95 84 84 84 84 84 84 84 84 83 83 83 83 83 83 83 83 83 82 82 17 7 5}
do_execsql_test 1.4.2.2 {
SELECT min(b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.4.3.1 {
SELECT row_number() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.4.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.4.3.3 {
SELECT row_number() OVER ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.4.4.1 {
SELECT dense_rank() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.4.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.4.4.3 {
SELECT dense_rank() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.4.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.4.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.4.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.4.5.1 {
SELECT rank() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.4.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.4.5.3 {
SELECT rank() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.4.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.4.5.5 {
SELECT rank() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.4.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.4.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.4.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.4.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.4.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206}
do_execsql_test 1.4.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.4.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.4.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.4.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.4.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.4.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.11.1 {
SELECT first_value(b) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.4.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.4.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99}
do_execsql_test 1.4.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 10 20 30 30 30 40 50 60 70 80 80 90 90 90 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 2 2 2 12 12 12 22 22 32 42 52 62 62 72 72 72 82 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 8 8 8 28 38 38 58 58 58 58 68 78 78 88 98 98 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99}
do_execsql_test 1.4.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.4.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.4.12.1 {
SELECT lead(b,b) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.13.1 {
SELECT lag(b,b) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.4.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.4.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.4.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.4.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.4.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.6
do_execsql_test 1.4.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 90.40.30.80.20.90.60.70.80.90.30.50.10.30 40.30.80.20.90.60.70.80.90.30.50.10.30 30.80.20.90.60.70.80.90.30.50.10.30 80.20.90.60.70.80.90.30.50.10.30 20.90.60.70.80.90.30.50.10.30 90.60.70.80.90.30.50.10.30 60.70.80.90.30.50.10.30 70.80.90.30.50.10.30 80.90.30.50.10.30 90.30.50.10.30 30.50.10.30 50.10.30 10.30 30 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.61.1.21.11.51.41.31.31.11.81.91.91.21 61.1.21.11.51.41.31.31.11.81.91.91.21 1.21.11.51.41.31.31.11.81.91.91.21 21.11.51.41.31.31.11.81.91.91.21 11.51.41.31.31.11.81.91.91.21 51.41.31.31.11.81.91.91.21 41.31.31.11.81.91.91.21 31.31.11.81.91.91.21 31.11.81.91.91.21 11.81.91.91.21 81.91.91.21 91.91.21 91.21 21 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 32.22.42.2.72.12.22.2.72.72.12.62.52.82 22.42.2.72.12.22.2.72.72.12.62.52.82 42.2.72.12.22.2.72.72.12.62.52.82 2.72.12.22.2.72.72.12.62.52.82 72.12.22.2.72.72.12.62.52.82 12.22.2.72.72.12.62.52.82 22.2.72.72.12.62.52.82 2.72.72.12.62.52.82 72.72.12.62.52.82 72.12.62.52.82 12.62.52.82 62.52.82 52.82 82 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 53.63.73.13.73.73.33.93.23.13.33.3.33.83 63.73.13.73.73.33.93.23.13.33.3.33.83 73.13.73.73.33.93.23.13.33.3.33.83 13.73.73.33.93.23.13.33.3.33.83 73.73.33.93.23.13.33.3.33.83 73.33.93.23.13.33.3.33.83 33.93.23.13.33.3.33.83 93.23.13.33.3.33.83 23.13.33.3.33.83 13.33.3.33.83 33.3.33.83 3.33.83 33.83 83 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 94.84.74.34.34.44.74.64.14.34.84.84.44.34 84.74.34.34.44.74.64.14.34.84.84.44.34 74.34.34.44.74.64.14.34.84.84.44.34 34.34.44.74.64.14.34.84.84.44.34 34.44.74.64.14.34.84.84.44.34 44.74.64.14.34.84.84.44.34 74.64.14.34.84.84.44.34 64.14.34.84.84.44.34 14.34.84.84.44.34 34.84.84.44.34 84.84.44.34 84.44.34 44.34 34 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 95.65.65.35.5.15.95.55.75.85.75.15.95.5 65.65.35.5.15.95.55.75.85.75.15.95.5 65.35.5.15.95.55.75.85.75.15.95.5 35.5.15.95.55.75.85.75.15.95.5 5.15.95.55.75.85.75.15.95.5 15.95.55.75.85.75.15.95.5 95.55.75.85.75.15.95.5 55.75.85.75.15.95.5 75.85.75.15.95.5 85.75.15.95.5 75.15.95.5 15.95.5 95.5 5 26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36 96.46.6.46.16.16.86.56.56.56.16.36.
do_execsql_test 1.4.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.
do_execsql_test 1.4.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 10.20.30.30.30.40.50.60.70.80.80.90.90.90 20.30.30.30.40.50.60.70.80.80.90.90.90 30.30.30.40.50.60.70.80.80.90.90.90 30.30.40.50.60.70.80.80.90.90.90 30.40.50.60.70.80.80.90.90.90 40.50.60.70.80.80.90.90.90 50.60.70.80.80.90.90.90 60.70.80.80.90.90.90 70.80.80.90.90.90 80.80.90.90.90 80.90.90.90 90.90.90 90.90 90 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 41.41.41.51.61.61.81.81.81.91.91.91.91.91 41.41.51.61.61.81.81.81.91.91.91.91.91 41.51.61.61.81.81.81.91.91.91.91.91 51.61.61.81.81.81.91.91.91.91.91 61.61.81.81.81.91.91.91.91.91 61.81.81.81.91.91.91.91.91 81.81.81.91.91.91.91.91 81.81.91.91.91.91.91 81.91.91.91.91.91 91.91.91.91.91 91.91.91.91 91.91.91 91.91 91 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 12.12.12.22.22.32.42.52.62.62.72.72.72.82 12.12.22.22.32.42.52.62.62.72.72.72.82 12.22.22.32.42.52.62.62.72.72.72.82 22.22.32.42.52.62.62.72.72.72.82 22.32.42.52.62.62.72.72.72.82 32.42.52.62.62.72.72.72.82 42.52.62.62.72.72.72.82 52.62.62.72.72.72.82 62.62.72.72.72.82 62.72.72.72.82 72.72.72.82 72.72.82 72.82 82 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.43.43.53.63.73.73.73.83.93.93.93 33.43.43.53.63.73.73.73.83.93.93.93 43.43.53.63.73.73.73.83.93.93.93 43.53.63.73.73.73.83.93.93.93 53.63.73.73.73.83.93.93.93 63.73.73.73.83.93.93.93 73.73.73.83.93.93.93 73.73.83.93.93.93 73.83.93.93.93 83.93.93.93 93.93.93 93.93 93 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 44.44.54.64.74.74.74.74.74.84.84.84.84.94 44.54.64.74.74.74.74.74.84.84.84.84.94 54.64.74.74.74.74.74.84.84.84.84.94 64.74.74.74.74.74.84.84.84.84.94 74.74.74.74.74.84.84.84.84.94 74.74.74.74.84.84.84.84.94 74.74.74.84.84.84.84.94 74.74.84.84.84.84.94 74.84.84.84.84.94 84.84.84.84.94 84.84.84.94 84.84.94 84.94 94 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 55.55.65.65.65.75.75.75.85.85.85.95.95.95 55.65.65.65.75.75.75.85.85.85.95.95.95 65.65.65.75.75.75.85.85.85.95.95.95 65.65.75.75.75.85.85.85.95.95.95 65.75.75.75.85.85.85.95.95.95 75.75.75.85.85.85.95.95.95 75.75.85.85.85.95.95.95 75.85.85.85.95.95.95 85.85.85.95.95.95 85.85.95.95.95 85.95.95.95 95.95.95 95.95 95 6.16.16.16.
do_execsql_test 1.4.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.
do_execsql_test 1.4.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.4.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
} {201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 200 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 199 74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 198 74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 197 99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 196 99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 195 33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 194 33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 193 89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 192 89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 191 96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 190 96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 189 38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 188 38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 187 39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.6
do_execsql_test 1.4.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
} {201 {} 200 {} 199 {} 198 {} 197 {} 196 {} 195 {} 194 {} 193 {} 192 {} 191 {} 190 {} 189 {} 188 {} 187 {} 186 {} 185 {} 184 {} 183 {} 182 {} 181 {} 180 {} 179 {} 178 {} 177 {} 176 {} 175 {} 174 {} 173 {} 172 {} 171 {} 170 {} 169 {} 168 {} 167 {} 166 {} 165 {} 164 {} 163 {} 162 {} 161 {} 160 {} 159 {} 158 {} 157 {} 156 {} 155 {} 154 {} 153 {} 152 {} 151 {} 150 {} 149 {} 148 {} 147 {} 146 {} 145 {} 144 {} 143 {} 142 {} 141 {} 140 {} 139 {} 138 {} 137 {} 136 {} 135 {} 134 {} 133 {} 132 {} 131 {} 130 {} 129 {} 128 {} 127 {} 126 {} 125 {} 124 {} 123 {} 122 {} 121 {} 120 {} 119 {} 118 {} 117 {} 116 {} 115 {} 114 {} 113 {} 112 {} 111 {} 110 {} 109 {} 108 {} 107 {} 106 {} 105 {} 104 {} 103 {} 102 {} 101 {} 100 {} 99 {} 98 {} 97 {} 96 {} 95 {} 94 {} 93 {} 92 {} 91 {} 90 {} 89 {} 88 {} 87 {} 86 {} 85 {} 84 {} 83 {} 82 {} 81 {} 80 {} 79 {} 78 {} 77 {} 76 {} 75 {} 74 {} 73 {} 72 {} 71 {} 70 {} 69 {} 68 {} 67 {} 66 {} 65 {} 64 {} 63 {} 62 {} 61 {} 60 {} 59 {} 58 {} 57 {} 56 {} 55 {} 54 {} 53 {} 52 {} 51 {} 50 {} 49 {} 48 {} 47 {} 46 {} 45 {} 44 {} 43 {} 42 {} 41 {} 40 {} 39 {} 38 {} 37 {} 36 {} 35 {} 34 {} 33 {} 32 {} 31 {} 30 {} 29 {} 28 {} 27 {} 26 {} 25 {} 24 {} 23 {} 22 {} 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {}}
do_execsql_test 1.4.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
} {20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {}}
do_execsql_test 1.4.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
} {20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 19 6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 18 29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 17 47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 16 59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 15 28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 14 75.78.72.98.87.73.96.74.90.75.91.69.39.7 13 78.72.98.87.73.96.74.90.75.91.69.39.7 12 72.98.87.73.96.74.90.75.91.69.39.7 11 98.87.73.96.74.90.75.91.69.39.7 10 87.73.96.74.90.75.91.69.39.7 9 73.96.74.90.75.91.69.39.7 8 96.74.90.75.91.69.39.7 7 74.90.75.91.69.39.7 6 90.75.91.69.39.7 5 75.91.69.39.7 4 91.69.39.7 3 69.39.7 2 39.7 1 7 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 19 96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 18 97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 17 84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 16 86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 15 32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 14 25.89.29.9.21.12.88.55.70.58.81.91.52.58 13 89.29.9.21.12.88.55.70.58.81.91.52.58 12 29.9.21.12.88.55.70.58.81.91.52.58 11 9.21.12.88.55.70.58.81.91.52.58 10 21.12.88.55.70.58.81.91.52.58 9 12.88.55.70.58.81.91.52.58 8 88.55.70.58.81.91.52.58 7 55.70.58.81.91.52.58 6 70.58.81.91.52.58 5 58.81.91.52.58 4 81.91.52.58 3 91.52.58 2 52.58 1 58 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 19 38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 18 46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 17 23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 16 61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 15 3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 14 1.76.63.73.65.20.8.77.19.9.23.15.50.38 13 76.63.73.65.20.8.77.19.9.23.15.50.38 12 63.73.65.20.8.77.19.9.23.15.50.38 11 73.65.20.8.77.19.9.23.15.50.38 10 65.20.8.77.19.9.23.15.50.38 9 20.8.77.19.9.23.15.50.38 8 8.77.19.9.23.15.50.38 7 77.19.9.23.15.50.38 6 19.9.23.15.50.38 5 9.23.15.50.38 4 23.15.50.38 3 15.50.38 2 50.38 1 38 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 19 39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 18 54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 17 16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 16 85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 15 22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 14 40.4.87.65.5.31.49.2.26.72.13.36.10.83 13 4.87.65.5.31.49.2.26.72.13.36.10.83 12 87.65.5.31.49.2.26.72.13.36.10.83 11 65.5.31.49.2.26.72.13.36.10.83 10 5.31.49.2.26.72.13.36.10.83 9 31.49.2.26.72.13.36.10.83 8 49.2.26.72.13.36.10.83 7 2.26.72.13.36.10.83 6 26.72.13.36.10.83 5 72.13.36.10.83 4 13.36.10.83 3 36.10.83 2 10.83 1 83 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 19 91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 18 8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 17 65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 16 85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 15 55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 14 56.42.80.58.11.95.90.85.47.33.14.3.33.82 13 42.80.58.11.95.90.85.47.33.14.3.33.82 12 80.58.11.95.90.85.47.33.14.3.33.82 11 58.11.95.90.85.47.33.14.3.33.82 10 11.95.90.85.47.33.14.3.33.82 9 95.90.85.47.33.14.3.33.82 8 90.85.47.33.14.3.33.82 7 85.47.33.14.3.33.82 6 47.33.14.3.33.82 5 33.14.3.33.82 4 14.3.33.82 3 3.33.82 2 33.82 1 82 20
do_execsql_test 1.5.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 0 74 74 74 74 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.5.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.5.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.5.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.5.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.5.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.5.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.5.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.5.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.5.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.5.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.5.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.5.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.5.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.5.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.5.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.5.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.5.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.5.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.5.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.5.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 1 76 44 78 28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224}
do_execsql_test 1.5.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 1 147 106 109 168 134 218 191 212 229 240 {} {} {} {} 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 {} {} {} {} 11 79 63 84 78 120 87 162 124 141 138 227 228 {} {} {} {} 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 {} {} {} {} 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 {} {} {} {} 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 {} {} {} {} 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 {} {} {} {} 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 {} {} {} {} 52 83 103 36 88 171 158 156 198 121 210 132 {} {} {} {} 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163}
do_execsql_test 1.5.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 1 65 102 11 87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171}
do_execsql_test 1.5.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 1 196 134 109 213 223 106 234 191 212 168 {} {} {} {} 65 102 119 136 123 210 146 147 44 132 152 160 105 154 92 156 243 109 {} {} {} {} 11 87 138 63 124 179 78 141 84 120 234 79 231 {} {} {} {} 57 181 110 179 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 {} {} {} {} 80 182 71 157 161 209 229 179 235 80 225 76 78 117 177 214 116 {} {} {} {} 111 206 74 132 189 87 74 140 113 187 103 161 169 145 208 235 131 133 {} {} {} {} 26 51 52 85 33 172 173 107 187 207 212 65 70 109 121 124 223 150 {} {} {} {} 48 144 207 216 50 224 124 202 87 110 195 200 196 96 110 211 {} {} {} {} 36 121 132 88 52 232 156 210 239 250 83 103 {} {} {} {} 101 163 172 163 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150}
do_execsql_test 1.5.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163}
do_execsql_test 1.5.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} 41 {} {} {} {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} 2 {} {} {} {} {} 46 62 62 {} {} {} {} 33 {} {} {} {} {} 78 {} 61 {} 59 77 {} 74 {} 27 {} {} 39 67 {} 54 85 74 90 7 61 90 62 {} 93 {} {} {} {} 23 {} 74 93 {} 23 29 3 1 41 {} 65 33 2 98 86 89 25 76 {} 40 38 15 {} {} 74 97 81 40 16 99 76 96 32 80 86 59 2 99 84 84 39 65 27 76 78 84 16 2 96 59 16 41 28 13 89 22 4 42 91 41 33 87 55 81 29 36 28 6 47 97 97 85 33 41 93 15 85 89 98 98 43 23 73 4 56 29 89 46 65 38 59 68 47 9 93 9 23 39 16 93 98 74 65 75 15 56 93 12 2 81 2 23 97 47 91 15 93 35 16 63 8 53 91 33 99}
do_execsql_test 1.5.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 81 {} {} {} {} {} {} 21 {} {} {} {} {} {} {} {} {} {} 12 {} {} {} 12 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 73 {} 23 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 15 {} {} {} {} {} {} 55 {} 15 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} {} 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 29 29 {} {} {}}
do_execsql_test 1.5.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} {} {} {} 2 2 2 2 3 3 3 3 4 4 4 5 5 5 5 6 6 7 7 7 7 7 7 8 8 8 8 8 8 8 9 9 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 17 17 17 17 19 19 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 25 25 25 25 26 26 27 27 28 29 29 29 29 29 29 30 30 30 30 30 30 30 30 30 31 31 31 32 32 33 33 33 33 33 33 33 34 34 34 35 35 35 35 35 35 36 36 36 36 36 36 36 36 36 36 36 37 37 37 38 38 38 38 38 39 39 39 39 39 39 40 40 40 41 41 41 41 42 42 42 43 43 43 43 43 43 43 43 44 44 44 46 46 46 46 47 47 47 47 47 47 47 47 47 47}
do_execsql_test 1.5.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} 90 1 30 {} {} {} {} 30 {} {} {} 1 40 {} 50 11 81 {} 40 {} 50 81 40 {} {} 50 {} {} {} 41 81 {} 41 {} 2 30 2 81 82 {} {} 10 {} {} 81 {} 41 10 81 30 81 {} {} 3 23 {} 3 61 80 {} {} 3 91 91 72 3 63 30 91 94 94 72 91 73 91 84 84 33 41 1 33 84 73 73 91 20 41 84 33 33 84 33 41 84 20 21 44 22 90 22 81 81 74 93 93 93 81 21 83 44 44 21 21 21 13 21 21 34 11 34 73 74 2 60 2 34 2 34 74 60 23 2 2 2 11 91 60 62 73 74 70 51 65 74 93 65 70 34 70 93 93 93 62 35 44 43 12 35 41 43 44 44 41 80 54 72 43 41 43 91 12 80 80 35 33 12}
do_execsql_test 1.5.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.5.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} 0 0 0 0 0 0 0 0 0 0 0 {} {} {} {} 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 {} {} {} {} 2 2 2 2 2 2 2 2 2 2 2 2 2 {} {} {} {} 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 {} {} {} {} 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 {} {} {} {} 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 {} {} {} {} 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 {} {} {} {} 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 {} {} {} {} 38 38 38 38 38 38 38 38 38 38 38 38 {} {} {} {} 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.5.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.5.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 0 0 0 0 0 0 0 0 0 0 0 {} {} {} {} 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 {} {} {} {} 2 2 2 2 2 2 2 2 2 2 2 2 2 {} {} {} {} 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 {} {} {} {} 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 {} {} {} {} 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 {} {} {} {} 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 {} {} {} {} 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 {} {} {} {} 8 8 8 8 8 8 8 8 8 8 8 8 {} {} {} {} 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9}
do_execsql_test 1.5.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.5.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.5.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.5.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.5.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.5.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} 0 0.74 0.74.41 0.74.41.74 0.74.41.74.23 0.74.41.74.23.99 0.74.41.74.23.99.26 0.74.41.74.23.99.26.33 0.74.41.74.23.99.26.33.2 0.74.41.74.23.99.26.33.2.89 0.74.41.74.23.99.26.33.2.89.81 0.74.41.74.23.99.26.33.2.89.81.96 0.74.41.74.23.99.26.33.2.89.81.96.59 0.74.41.74.23.99.26.33.2.89.81.96.59.38 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32
do_execsql_test 1.5.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} 0 0.90 0.90.40 0.90.40.30 0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 0.90.40.30.80.20.90.60 0.90.40.30.80.20.90.60.70 0.90.40.30.80.20.90.60.70.80 0.90.40.30.80.20.90.60.70.80.90 {} {} {} {} 41 41.81 41.81.91 41.81.91.61 41.81.91.61.91 41.81.91.61.91.91 41.81.91.61.91.91.1 41.81.91.61.91.91.1.81 41.81.91.61.91.91.1.81.41 41.81.91.61.91.91.1.81.41.61 41.81.91.61.91.91.1.81.41.61.1 41.81.91.61.91.91.1.81.41.61.1.21 41.81.91.61.91.91.1.81.41.61.1.21.11 41.81.91.61.91.91.1.81.41.61.1.21.11.51 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11 {} {} {} {} 2 2.62 2.62.12 2.62.12.32 2.62.12.32.22 2.62.12.32.22.42 2.62.12.32.22.42.2 2.62.12.32.22.42.2.72 2.62.12.32.22.42.2.72.12 2.62.12.32.22.42.2.72.12.22 2.62.12.32.22.42.2.72.12.22.2 2.62.12.32.22.42.2.72.12.22.2.72 2.62.12.32.22.42.2.72.12.22.2.72.72 {} {} {} {} 23 23.33 23.33.93 23.33.93.23 23.33.93.23.93 23.33.93.23.93.43 23.33.93.23.93.43.3 23.33.93.23.93.43.3.43 23.33.93.23.93.43.3.43.33 23.33.93.23.93.43.3.43.33.53 23.33.93.23.93.43.3.43.33.53.63 23.33.93.23.93.43.3.43.33.53.63.73 23.33.93.23.93.43.3.43.33.53.63.73.13 23.33.93.23.93.43.3.43.33.53.63.73.13.73 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13 {} {} {} {} 74 74.74 74.74.54 74.74.54.84 74.74.54.84.74 74.74.54.84.74.24 74.74.54.84.74.24.4 74.74.54.84.74.24.4.94 74.74.54.84.74.24.4.94.84 74.74.54.84.74.24.4.94.84.74 74.74.54.84.74.24.4.94.84.74.34 74.74.54.84.74.24.4.94.84.74.34.34 74.74.54.84.74.24.4.94.84.74.34.34.44 74.74.54.84.74.24.4.94.84.74.34.34.44.74 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34 {} {} {} {} 65 65.35 65.35.85 65.35.85.85 65.35.85.85.55 65.35.85.85.55.15 65.35.85.85.55.15.25 65.35.85.85.55.15.25.75 65.35.85.85.55.15.25.75.95 65.35.85.85.55.15.25.75.95.65 65.35.85.85.55.15.25.75.95.65.65 65.35.85.85.55.15.25.75.95.65.65.35 65.35.85.85.55.15.25.75.95.65.65.35.5 65.35.85.85.55.15.25.75.95.65.65.35.5.15 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85 {} {} {} {} 26 26.96 26.96.46 26.96.46.6 26.96.46.6.46 26.96.46.6.46.16 26.96.46.6.46.16.16 26.96.46.6.46.16.16.86 26.96.46.6.46.16.16.86.56 26.96.46.6.46.16.16.86.56.56 26.96.46.6.46.16.16.86.56.56.56 26.96.46.6.46.16.16.86.56.56.56.16 26.96.46.6.46.16.16.86.56.56.56.16.36 26.96.46.6.46.16.16.86.56.56.56.16.36.76 26.96.46.6.46.16.16.86.56.56.56.16.36.76.96 26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96 26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26 26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26 {} {} {} {} 97 97.27 97.27.97 97.27.97.67 97.27.97.67.77 97.27.97.67.77.47 97.27.97.67.77.47.7 97.27.97.67.77.47.7.47 97.27.97.67.77.47.7.47.87 97.27.97.67.77.47.7.47.87.37 97.27.97.67.77.47.7.47.87.37.87 97.27.97.67.77.47.7.47.87.37.87.77 97.27.97.67.77.47.7.47.87.37.87.77.7 97.27.97.67.77.47.7.47.87.37.87.77.7.57 97.27.97.67.77.47.7.47.87.37.87.77.7.57.47 97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47 {} {} {} {} 38 38.68 38.68.78 38.68.78.8 38.68.78.8.28 38.68.78.8.28.98 38.68.78.8.28.98.78 38.68.78.8.28.98.78.58 38.68.78.8.28.98.78.58.98 38.68.78.8.28.98.78.58.98.8 38.68.78.8.28.98.78.58.98.8.88 38.68.78.8.28.98.78.58.98.8.88.8 {} {} {} {} 99 99.89 99.89.59 99.89.59.39 99.89.59.39.99
do_execsql_test 1.5.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 0 0.1 0.1.1 0.1.1.2 0.1.1.2.2 0.1.1.2.2.2 0.1.1.2.2.2.3 0.1.1.2.2.2.3.3 0.1.1.2.2.2.3.3.4 0.1.1.2.2.2.3.3.4.5 0.1.1.2.2.2.3.3.4.5.5 0.1.1.2.2.2.3.3.4.5.5.6 0.1.1.2.2.2.3.3.4.5.5.6.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.
do_execsql_test 1.5.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 0 0.10 0.10.20 0.10.20.30 0.10.20.30.30 0.10.20.30.30.30 0.10.20.30.30.30.40 0.10.20.30.30.30.40.50 0.10.20.30.30.30.40.50.60 0.10.20.30.30.30.40.50.60.70 0.10.20.30.30.30.40.50.60.70.80 {} {} {} {} 1 1.1 1.1.11 1.1.11.11 1.1.11.11.21 1.1.11.11.21.21 1.1.11.11.21.21.31 1.1.11.11.21.21.31.31 1.1.11.11.21.21.31.31.41 1.1.11.11.21.21.31.31.41.41 1.1.11.11.21.21.31.31.41.41.41 1.1.11.11.21.21.31.31.41.41.41.51 1.1.11.11.21.21.31.31.41.41.41.51.61 1.1.11.11.21.21.31.31.41.41.41.51.61.61 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91 {} {} {} {} 2 2.2 2.2.2 2.2.2.12 2.2.2.12.12 2.2.2.12.12.12 2.2.2.12.12.12.22 2.2.2.12.12.12.22.22 2.2.2.12.12.12.22.22.32 2.2.2.12.12.12.22.22.32.42 2.2.2.12.12.12.22.22.32.42.52 2.2.2.12.12.12.22.22.32.42.52.62 2.2.2.12.12.12.22.22.32.42.52.62.62 {} {} {} {} 3 3.3 3.3.13 3.3.13.13 3.3.13.13.23 3.3.13.13.23.23 3.3.13.13.23.23.23 3.3.13.13.23.23.23.33 3.3.13.13.23.23.23.33.33 3.3.13.13.23.23.23.33.33.33 3.3.13.13.23.23.23.33.33.33.33 3.3.13.13.23.23.23.33.33.33.33.33 3.3.13.13.23.23.23.33.33.33.33.33.43 3.3.13.13.23.23.23.33.33.33.33.33.43.43 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73 {} {} {} {} 4 4.14 4.14.24 4.14.24.34 4.14.24.34.34 4.14.24.34.34.34 4.14.24.34.34.34.34 4.14.24.34.34.34.34.44 4.14.24.34.34.34.34.44.44 4.14.24.34.34.34.34.44.44.54 4.14.24.34.34.34.34.44.44.54.64 4.14.24.34.34.34.34.44.44.54.64.74 4.14.24.34.34.34.34.44.44.54.64.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84 {} {} {} {} 5 5.5 5.5.15 5.5.15.15 5.5.15.15.15 5.5.15.15.15.25 5.5.15.15.15.25.35 5.5.15.15.15.25.35.35 5.5.15.15.15.25.35.35.55 5.5.15.15.15.25.35.35.55.55 5.5.15.15.15.25.35.35.55.55.65 5.5.15.15.15.25.35.35.55.55.65.65 5.5.15.15.15.25.35.35.55.55.65.65.65 5.5.15.15.15.25.35.35.55.55.65.65.65.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85 {} {} {} {} 6 6.16 6.16.16 6.16.16.16 6.16.16.16.26 6.16.16.16.26.26 6.16.16.16.26.26.26 6.16.16.16.26.26.26.36 6.16.16.16.26.26.26.36.36 6.16.16.16.26.26.26.36.36.36 6.16.16.16.26.26.26.36.36.36.36 6.16.16.16.26.26.26.36.36.36.36.46 6.16.16.16.26.26.26.36.36.36.36.46.46 6.16.16.16.26.26.26.36.36.36.36.46.46.56 6.16.16.16.26.26.26.36.36.36.36.46.46.56.56 6.16.16.16.26.26.26.36.36.36.36.46.46.56.56.56 6.16.16.16.26.26.26.36.36.36.36.46.46.56.56.56.66 6.16.16.16.26.26.26.36.36.36.36.46.46.56.56.56.66.76 {} {} {} {} 7 7.7 7.7.7 7.7.7.17 7.7.7.17.27 7.7.7.17.27.27 7.7.7.17.27.27.37 7.7.7.17.27.27.37.37 7.7.7.17.27.27.37.37.47 7.7.7.17.27.27.37.37.47.47 7.7.7.17.27.27.37.37.47.47.47 7.7.7.17.27.27.37.37.47.47.47.47 7.7.7.17.27.27.37.37.47.47.47.47.57 7.7.7.17.27.27.37.37.47.47.47.47.57.67 7.7.7.17.27.27.37.37.47.47.47.47.57.67.77 7.7.7.17.27.27.37.37.47.47.47.47.57.67.77.77 {} {} {} {} 8 8.8 8.8.8 8.8.8.28 8.8.8.28.38 8.8.8.28.38.38 8.8.8.28.38.38.58 8.8.8.28.38.38.58.58 8.8.8.28.38.38.58.58.58 8.8.8.28.38.38.58.58.58.58 8.8.8.28.38.38.58.58.58.58.68 8.8.8.28.38.38.58.58.58.58.68.78 {} {} {} {} 9 9.9 9.9.9 9.9.9.19 9.9.9.19.29 9.9.9.19.29.29 9.9.9.19.29.29.29 9.9.9.19.29.29.29.39 9.9.9.19.29.29.29.39.39 9.9.9.19.29.29.29.39.39.39 9.9.9.19.29.29.29.39.39.39.49 9.9.
do_execsql_test 1.5.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING ) FROM t2
} {{} {} {} {} 0 0.90 0.90.40 0.90.40.30 0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 0.90.40.30.80.20.90.60 0.90.40.30.80.20.90.60.70 0.90.40.30.80.20.90.60.70.80 0.90.40.30.80.20.90.60.70.80.90 0.90.40.30.80.20.90.60.70.80.90.30 0.90.40.30.80.20.90.60.70.80.90.30.50 0.90.40.30.80.20.90.60.70.80.90.30.50.10 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.
do_execsql_test 1.5.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.5.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING)
} {0 {} 0 {} 0 {} 0 {} 1 {} 2 74 3 74 4 74.74 5 74.74 6 74.74.99 7 74.74.99 8 74.74.99.33 9 74.74.99.33 10 74.74.99.33.89 11 74.74.99.33.89 12 74.74.99.33.89.96 13 74.74.99.33.89.96 14 74.74.99.33.89.96.38 15 74.74.99.33.89.96.38 16 74.74.99.33.89.96.38.39 17 74.74.99.33.89.96.38.39 18 74.74.99.33.89.96.38.39.91 19 74.74.99.33.89.96.38.39.91 20 74.74.99.33.89.96.38.39.91.6 21 74.74.99.33.89.96.38.39.91.6 22 74.74.99.33.89.96.38.39.91.6.97 23 74.74.99.33.89.96.38.39.91.6.97 24 74.74.99.33.89.96.38.39.91.6.97.46 25 74.74.99.33.89.96.38.39.91.6.97.46 26 74.74.99.33.89.96.38.39.91.6.97.46.54 27 74.74.99.33.89.96.38.39.91.6.97.46.54 28 74.74.99.33.89.96.38.39.91.6.97.46.54.8 29 74.74.99.33.89.96.38.39.91.6.97.46.54.8 30 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29 31 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29 32 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84 33 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84 34 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23 35 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23 36 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16 37 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16 38 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65 39 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65 40 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47 41 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47 42 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86 43 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86 44 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61 45 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61 46 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85 47 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85 48 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85 49 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85 50 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59 51 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59 52 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32 53 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32 54 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3 55 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3 56 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22 57 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22 58 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55 59 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55 60 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28 61 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28 62 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25 63 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25 64 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1 65 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1 66 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40 67 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40 68 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56 69 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56 70 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75 71 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75 72 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65
do_execsql_test 1.5.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING)
} {0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 22 {} 23 {} 24 {} 25 {} 26 {} 27 {} 28 {} 29 {} 30 {} 31 {} 32 {} 33 {} 34 {} 35 {} 36 {} 37 {} 38 {} 39 {} 40 {} 41 {} 42 {} 43 {} 44 {} 45 {} 46 {} 47 {} 48 {} 49 {} 50 {} 51 {} 52 {} 53 {} 54 {} 55 {} 56 {} 57 {} 58 {} 59 {} 60 {} 61 {} 62 {} 63 {} 64 {} 65 {} 66 {} 67 {} 68 {} 69 {} 70 {} 71 {} 72 {} 73 {} 74 {} 75 {} 76 {} 77 {} 78 {} 79 {} 80 {} 81 {} 82 {} 83 {} 84 {} 85 {} 86 {} 87 {} 88 {} 89 {} 90 {} 91 {} 92 {} 93 {} 94 {} 95 {} 96 {} 97 {} 98 {} 99 {} 100 {} 101 {} 102 {} 103 {} 104 {} 105 {} 106 {} 107 {} 108 {} 109 {} 110 {} 111 {} 112 {} 113 {} 114 {} 115 {} 116 {} 117 {} 118 {} 119 {} 120 {} 121 {} 122 {} 123 {} 124 {} 125 {} 126 {} 127 {} 128 {} 129 {} 130 {} 131 {} 132 {} 133 {} 134 {} 135 {} 136 {} 137 {} 138 {} 139 {} 140 {} 141 {} 142 {} 143 {} 144 {} 145 {} 146 {} 147 {} 148 {} 149 {} 150 {} 151 {} 152 {} 153 {} 154 {} 155 {} 156 {} 157 {} 158 {} 159 {} 160 {} 161 {} 162 {} 163 {} 164 {} 165 {} 166 {} 167 {} 168 {} 169 {} 170 {} 171 {} 172 {} 173 {} 174 {} 175 {} 176 {} 177 {} 178 {} 179 {} 180 {} 181 {} 182 {} 183 {} 184 {} 185 {} 186 {} 187 {} 188 {} 189 {} 190 {} 191 {} 192 {} 193 {} 194 {} 195 {} 196 {} 197 {}}
do_execsql_test 1.5.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING)
} {0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {}}
do_execsql_test 1.5.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 PRECEDING)
} {0 {} 0 {} 0 {} 0 {} 1 89 2 89.6 3 89.6.29 4 89.6.29.47 5 89.6.29.47.59 6 89.6.29.47.59.28 7 89.6.29.47.59.28.75 8 89.6.29.47.59.28.75.78 9 89.6.29.47.59.28.75.78.72 10 89.6.29.47.59.28.75.78.72.98 11 89.6.29.47.59.28.75.78.72.98.87 12 89.6.29.47.59.28.75.78.72.98.87.73 13 89.6.29.47.59.28.75.78.72.98.87.73.96 14 89.6.29.47.59.28.75.78.72.98.87.73.96.74 15 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90 16 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 0 {} 0 {} 0 {} 0 {} 1 74 2 74.96 3 74.96.97 4 74.96.97.84 5 74.96.97.84.86 6 74.96.97.84.86.32 7 74.96.97.84.86.32.25 8 74.96.97.84.86.32.25.89 9 74.96.97.84.86.32.25.89.29 10 74.96.97.84.86.32.25.89.29.9 11 74.96.97.84.86.32.25.89.29.9.21 12 74.96.97.84.86.32.25.89.29.9.21.12 13 74.96.97.84.86.32.25.89.29.9.21.12.88 14 74.96.97.84.86.32.25.89.29.9.21.12.88.55 15 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70 16 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 74 2 74.38 3 74.38.46 4 74.38.46.23 5 74.38.46.23.61 6 74.38.46.23.61.3 7 74.38.46.23.61.3.1 8 74.38.46.23.61.3.1.76 9 74.38.46.23.61.3.1.76.63 10 74.38.46.23.61.3.1.76.63.73 11 74.38.46.23.61.3.1.76.63.73.65 12 74.38.46.23.61.3.1.76.63.73.65.20 13 74.38.46.23.61.3.1.76.63.73.65.20.8 14 74.38.46.23.61.3.1.76.63.73.65.20.8.77 15 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19 16 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 99 2 99.39 3 99.39.54 4 99.39.54.16 5 99.39.54.16.85 6 99.39.54.16.85.22 7 99.39.54.16.85.22.40 8 99.39.54.16.85.22.40.4 9 99.39.54.16.85.22.40.4.87 10 99.39.54.16.85.22.40.4.87.65 11 99.39.54.16.85.22.40.4.87.65.5 12 99.39.54.16.85.22.40.4.87.65.5.31 13 99.39.54.16.85.22.40.4.87.65.5.31.49 14 99.39.54.16.85.22.40.4.87.65.5.31.49.2 15 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26 16 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 0 {} 0 {} 0 {} 0 {} 1 33 2 33.91 3 33.91.8 4 33.91.8.65 5 33.91.8.65.85 6 33.91.8.65.85.55 7 33.91.8.65.85.55.56 8 33.91.8.65.85.55.56.42 9 33.91.8.65.85.55.56.42.80 10 33.91.8.65.85.55.56.42.80.58 11 33.91.8.65.85.55.56.42.80.58.11 12 33.91.8.65.85.55.56.42.80.58.11.95 13 33.91.8.65.85.55.56.42.80.58.11.95.90 14 33.91.8.65.85.55.56.42.80.58.11.95.90.85 15 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47 16 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33 0 {} 0 {} 0 {} 0 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {}}
do_execsql_test 1.6.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 0 74 74 74 74 99 99 99 33 89 89 96 96 96 68 68 68 91 91 91 99 99 99 97 78 78 97 97 97 67 93 93 93 84 77 23 93 93 93 65 47 86 86 86 91 91 91 85 85 85 59 59 56 56 91 91 91 90 90 55 89 89 89 47 56 56 56 56 56 75 75 89 98 98 98 81 94 94 94 78 78 78 53 63 63 87 87 87 84 84 84 72 61 73 95 95 95 65 96 98 98 98 74 74 74 65 73 73 73 87 87 87 41 20 31 31 31 95 95 95 79 88 88 88 34 49 49 90 90 96 96 96 75 77 77 77 44 85 85 85 74 74 70 70 59 39 39 47 80 90 90 90 58 58 72 72 72 72 93 93 93 81 81 81 37 37 37 14 62 91 91 91 91 91 34 36 99 99 99 95 95 69 58 52 84 84 84 84 84 39 44 58 58 58 38 83 83 83 82}
do_execsql_test 1.6.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 0 0 0 41 23 23 23 26 2 2 2 81 59 38 38 38 39 39 46 6 6 6 27 27 27 46 54 8 8 8 29 29 77 23 16 16 16 16 35 35 7 7 7 61 61 61 24 24 24 43 12 12 12 3 3 3 22 22 15 15 15 25 25 1 1 1 40 40 16 16 16 36 36 76 76 4 4 4 30 30 30 29 29 29 2 2 2 37 37 72 41 9 9 9 61 65 13 13 13 58 1 1 1 21 35 5 5 5 11 11 41 12 8 8 8 20 15 15 15 22 22 73 34 8 8 8 11 34 34 59 59 55 55 55 44 2 2 2 7 57 29 29 29 19 19 19 26 26 26 47 36 36 36 9 9 9 66 33 33 33 64 64 9 9 9 13 12 12 12 14 36 36 33 15 15 15 34 3 3 3 58 52 30 30 30 10 10 10 21 21 21 39 30 30 30 34 27 27 17}
do_execsql_test 1.6.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.6.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.6.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.6.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.6.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.6.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.6.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.6.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.6.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.6.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.6.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.6.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.6.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.6.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.6.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.6.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.6.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.6.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.6.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 1 76 44 78 28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216}
do_execsql_test 1.6.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 1 147 106 109 168 134 218 191 212 229 240 213 234 {} {} 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 {} {} 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 {} {} 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 {} {} 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 {} {} 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 {} {} 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 {} {} 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 {} {} 52 83 103 36 88 171 158 156 198 121 210 132 210 239 {} {} 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276}
do_execsql_test 1.6.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 1 65 102 11 87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105}
do_execsql_test 1.6.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 1 196 134 109 213 223 106 234 191 212 168 229 147 {} {} 65 102 119 136 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 {} {} 11 87 138 63 124 179 78 141 84 120 234 79 231 162 227 {} {} 57 181 110 179 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 {} {} 80 182 71 157 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 {} {} 111 206 74 132 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 {} {} 26 51 52 85 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 {} {} 48 144 207 216 50 224 124 202 87 110 195 200 196 96 110 211 173 197 {} {} 36 121 132 88 52 232 156 210 239 250 83 103 158 210 {} {} 101 163 172 163 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105}
do_execsql_test 1.6.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276}
do_execsql_test 1.6.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 77 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 22 {} {} {} 12 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} {} {} 1 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 81 {} {} {} {} {} {} {} {} {} {} {} 91 {} {} {} {} {} 22 {} {} {} 12 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} 0 0 0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27}
do_execsql_test 1.6.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} 0 0 0 90 40 30 80 20 90 60 70 80 90 {} {} 41 41 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 {} {} 2 2 2 62 12 32 22 42 2 72 12 22 2 72 72 {} {} 23 23 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 {} {} 74 74 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 {} {} 65 65 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 {} {} 26 26 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 {} {} 97 97 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 {} {} 38 38 38 68 78 8 28 98 78 58 98 8 88 8 {} {} 99 99 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9}
do_execsql_test 1.6.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 0 0 0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98}
do_execsql_test 1.6.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 0 0 0 10 20 30 30 30 40 50 60 70 80 {} {} 1 1 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 {} {} 2 2 2 2 2 12 12 12 22 22 32 42 52 62 62 {} {} 3 3 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 {} {} 4 4 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 {} {} 5 5 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 {} {} 6 6 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 {} {} 7 7 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 {} {} 8 8 8 8 8 28 38 38 58 58 58 58 68 78 {} {} 9 9 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89}
do_execsql_test 1.6.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 0 0 0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9}
do_execsql_test 1.6.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.6.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.6.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.6.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.6.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} 0 0.74 0.74.41 74.41.74 41.74.23 74.23.99 23.99.26 99.26.33 26.33.2 33.2.89 2.89.81 89.81.96 81.96.59 96.59.38 59.38.68 38.68.39 68.39.62 39.62.91 62.91.46 91.46.6 46.6.99 6.99.97 99.97.27 97.27.46 27.46.78 46.78.54 78.54.97 54.97.8 97.8.67 8.67.29 67.29.93 29.93.84 93.84.77 84.77.23 77.23.16 23.16.16 16.16.93 16.93.65 93.65.35 65.35.47 35.47.7 47.7.86 7.86.74 86.74.61 74.61.91 61.91.85 91.85.24 85.24.85 24.85.43 85.43.59 43.59.12 59.12.32 12.32.56 32.56.3 56.3.91 3.91.22 91.22.90 22.90.55 90.55.15 55.15.28 15.28.89 28.89.25 89.25.47 25.47.1 47.1.56 1.56.40 56.40.43 40.43.56 43.56.16 56.16.75 16.75.36 75.36.89 36.89.98 89.98.76 98.76.81 76.81.4 81.4.94 4.94.42 94.42.30 42.30.78 30.78.33 78.33.29 33.29.53 29.53.63 53.63.2 63.2.87 2.87.37 87.37.80 37.80.84 80.84.72 84.72.41 72.41.9 41.9.61 9.61.73 61.73.95 73.95.65 95.65.13 65.13.58 13.58.96 58.96.98 96.98.1 98.1.21 1.21.74 21.74.65 74.65.35 65.35.5 35.5.73 5.73.11 73.11.51 11.51.87 51.87.41 87.41.12 41.12.8 12.8.20 8.20.31 20.31.31 31.31.15 31.15.95 15.95.22 95.22.73 22.73.79 73.79.88 79.88.34 88.34.8 34.8.11 8.11.49 11.49.34 49.34.90 34.90.59 90.59.96 59.96.60 96.60.55 60.55.75 55.75.77 75.77.44 77.44.2 44.2.7 2.7.85 7.85.57 85.57.74 57.74.29 74.29.70 29.70.59 70.59.19 59.19.39 19.39.26 39.26.26 26.26.47 26.47.80 47.80.90 80.90.36 90.36.58 36.58.47 58.47.9 47.9.72 9.72.72 72.72.66 72.66.33 66.33.93 33.93.75 93.75.64 75.64.81 64.81.9 81.9.23 9.23.37 23.37.13 37.13.12 13.12.14 12.14.62 14.62.91 62.91.36 91.36.91 36.91.33 91.33.15 33.15.34 15.34.36 34.36.99 36.99.3 99.3.95 3.95.69 95.69.58 69.58.52 58.52.30 52.30.50 30.50.84 50.84.10 84.10.84 10.84.33 84.33.21 33.21.39 21.39.44 39.44.58 44.58.30 58.30.38 30.38.34 38.34.83 34.83.27 83.27.82 27.82.17}
do_execsql_test 1.6.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} 0 0.90 0.90.40 90.40.30 40.30.80 30.80.20 80.20.90 20.90.60 90.60.70 60.70.80 70.80.90 80.90.30 90.30.50 {} {} 41 41.81 41.81.91 81.91.61 91.61.91 61.91.91 91.91.1 91.1.81 1.81.41 81.41.61 41.61.1 61.1.21 1.21.11 21.11.51 11.51.41 51.41.31 41.31.31 31.31.11 31.11.81 11.81.91 {} {} 2 2.62 2.62.12 62.12.32 12.32.22 32.22.42 22.42.2 42.2.72 2.72.12 72.12.22 12.22.2 22.2.72 2.72.72 72.72.12 72.12.62 {} {} 23 23.33 23.33.93 33.93.23 93.23.93 23.93.43 93.43.3 43.3.43 3.43.33 43.33.53 33.53.63 53.63.73 63.73.13 73.13.73 13.73.73 73.73.33 73.33.93 33.93.23 93.23.13 23.13.33 13.33.3 {} {} 74 74.74 74.74.54 74.54.84 54.84.74 84.74.24 74.24.4 24.4.94 4.94.84 94.84.74 84.74.34 74.34.34 34.34.44 34.44.74 44.74.64 74.64.14 64.14.34 14.34.84 34.84.84 {} {} 65 65.35 65.35.85 35.85.85 85.85.55 85.55.15 55.15.25 15.25.75 25.75.95 75.95.65 95.65.65 65.65.35 65.35.5 35.5.15 5.15.95 15.95.55 95.55.75 55.75.85 75.85.75 85.75.15 {} {} 26 26.96 26.96.46 96.46.6 46.6.46 6.46.16 46.16.16 16.16.86 16.86.56 86.56.56 56.56.56 56.56.16 56.16.36 16.36.76 36.76.96 76.96.96 96.96.26 96.26.26 26.26.36 26.36.66 {} {} 97 97.27 97.27.97 27.97.67 97.67.77 67.77.47 77.47.7 47.7.47 7.47.87 47.87.37 87.37.87 37.87.77 87.77.7 77.7.57 7.57.47 57.47.47 47.47.37 47.37.27 {} {} 38 38.68 38.68.78 68.78.8 78.8.28 8.28.98 28.98.78 98.78.58 78.58.98 58.98.8 98.8.88 8.88.8 88.8.58 8.58.58 {} {} 99 99.89 99.89.59 89.59.39 59.39.99 39.99.29 99.29.59 29.59.89 59.89.89 89.89.29 89.29.9 29.9.79 9.79.49 79.49.59 49.59.29 59.29.59 29.59.19 59.19.39 19.39.9 39.9.9 9.9.99}
do_execsql_test 1.6.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 0 0.1 0.1.1 1.1.2 1.2.2 2.2.2 2.2.3 2.3.3 3.3.4 3.4.5 4.5.5 5.5.6 5.6.7 6.7.7 7.7.7 7.7.8 7.8.8 8.8.8 8.8.9 8.9.9 9.9.9 9.9.10 9.10.11 10.11.11 11.11.12 11.12.12 12.12.12 12.12.13 12.13.13 13.13.14 13.14.15 14.15.15 15.15.15 15.15.16 15.16.16 16.16.16 16.16.17 16.17.19 17.19.20 19.20.21 20.21.21 21.21.22 21.22.22 22.22.23 22.23.23 23.23.23 23.23.24 23.24.25 24.25.26 25.26.26 26.26.26 26.26.27 26.27.27 27.27.28 27.28.29 28.29.29 29.29.29 29.29.30 29.30.30 30.30.30 30.30.31 30.31.31 31.31.32 31.32.33 32.33.33 33.33.33 33.33.33 33.33.33 33.33.34 33.34.34 34.34.34 34.34.34 34.34.35 34.35.35 35.35.36 35.36.36 36.36.36 36.36.36 36.36.37 36.37.37 37.37.38 37.38.38 38.38.39 38.39.39 39.39.39 39.39.40 39.40.41 40.41.41 41.41.41 41.41.42 41.42.43 42.43.43 43.43.44 43.44.44 44.44.46 44.46.46 46.46.47 46.47.47 47.47.47 47.47.47 47.47.49 47.49.50 49.50.51 50.51.52 51.52.53 52.53.54 53.54.55 54.55.55 55.55.56 55.56.56 56.56.56 56.56.57 56.57.58 57.58.58 58.58.58 58.58.58 58.58.59 58.59.59 59.59.59 59.59.59 59.59.60 59.60.61 60.61.61 61.61.62 61.62.62 62.62.63 62.63.64 63.64.65 64.65.65 65.65.65 65.65.66 65.66.67 66.67.68 67.68.69 68.69.70 69.70.72 70.72.72 72.72.72 72.72.73 72.73.73 73.73.73 73.73.74 73.74.74 74.74.74 74.74.74 74.74.74 74.74.75 74.75.75 75.75.75 75.75.76 75.76.77 76.77.77 77.77.78 77.78.78 78.78.79 78.79.80 79.80.80 80.80.81 80.81.81 81.81.81 81.81.82 81.82.83 82.83.84 83.84.84 84.84.84 84.84.84 84.84.85 84.85.85 85.85.85 85.85.86 85.86.87 86.87.87 87.87.88 87.88.89 88.89.89 89.89.89 89.89.90 89.90.90 90.90.90 90.90.91 90.91.91 91.91.91 91.91.91 91.91.91 91.91.93 91.93.93 93.93.93 93.93.94 93.94.95 94.95.95 95.95.95 95.95.96 95.96.96 96.96.96 96.96.97 96.97.97 97.97.98 97.98.98 98.98.99}
do_execsql_test 1.6.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 0 0.10 0.10.20 10.20.30 20.30.30 30.30.30 30.30.40 30.40.50 40.50.60 50.60.70 60.70.80 70.80.80 80.80.90 {} {} 1 1.1 1.1.11 1.11.11 11.11.21 11.21.21 21.21.31 21.31.31 31.31.41 31.41.41 41.41.41 41.41.51 41.51.61 51.61.61 61.61.81 61.81.81 81.81.81 81.81.91 81.91.91 91.91.91 {} {} 2 2.2 2.2.2 2.2.12 2.12.12 12.12.12 12.12.22 12.22.22 22.22.32 22.32.42 32.42.52 42.52.62 52.62.62 62.62.72 62.72.72 {} {} 3 3.3 3.3.13 3.13.13 13.13.23 13.23.23 23.23.23 23.23.33 23.33.33 33.33.33 33.33.33 33.33.33 33.33.43 33.43.43 43.43.53 43.53.63 53.63.73 63.73.73 73.73.73 73.73.83 73.83.93 {} {} 4 4.14 4.14.24 14.24.34 24.34.34 34.34.34 34.34.34 34.34.44 34.44.44 44.44.54 44.54.64 54.64.74 64.74.74 74.74.74 74.74.74 74.74.74 74.74.84 74.84.84 84.84.84 {} {} 5 5.5 5.5.15 5.15.15 15.15.15 15.15.25 15.25.35 25.35.35 35.35.55 35.55.55 55.55.65 55.65.65 65.65.65 65.65.75 65.75.75 75.75.75 75.75.85 75.85.85 85.85.85 85.85.95 {} {} 6 6.16 6.16.16 16.16.16 16.16.26 16.26.26 26.26.26 26.26.36 26.36.36 36.36.36 36.36.36 36.36.46 36.46.46 46.46.56 46.56.56 56.56.56 56.56.66 56.66.76 66.76.86 76.86.96 {} {} 7 7.7 7.7.7 7.7.17 7.17.27 17.27.27 27.27.37 27.37.37 37.37.47 37.47.47 47.47.47 47.47.47 47.47.57 47.57.67 57.67.77 67.77.77 77.77.87 77.87.87 {} {} 8 8.8 8.8.8 8.8.28 8.28.38 28.38.38 38.38.58 38.58.58 58.58.58 58.58.58 58.58.68 58.68.78 68.78.78 78.78.88 {} {} 9 9.9 9.9.9 9.9.19 9.19.29 19.29.29 29.29.29 29.29.39 29.39.39 39.39.39 39.39.49 39.49.59 49.59.59 59.59.59 59.59.59 59.59.69 59.69.79 69.79.89 79.89.89 89.89.89 89.89.99}
do_execsql_test 1.6.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING ) FROM t2
} {{} {} 0 0.90 0.90.40 90.40.30 40.30.80 30.80.20 80.20.90 20.90.60 90.60.70 60.70.80 70.80.90 80.90.30 90.30.50 30.50.10 50.10.30 10.30.41 30.41.81 41.81.91 81.91.61 91.61.91 61.91.91 91.91.1 91.1.81 1.81.41 81.41.61 41.61.1 61.1.21 1.21.11 21.11.51 11.51.41 51.41.31 41.31.31 31.31.11 31.11.81 11.81.91 81.91.91 91.91.21 91.21.2 21.2.62 2.62.12 62.12.32 12.32.22 32.22.42 22.42.2 42.2.72 2.72.12 72.12.22 12.22.2 22.2.72 2.72.72 72.72.12 72.12.62 12.62.52 62.52.82 52.82.23 82.23.33 23.33.93 33.93.23 93.23.93 23.93.43 93.43.3 43.3.43 3.43.33 43.33.53 33.53.63 53.63.73 63.73.13 73.13.73 13.73.73 73.73.33 73.33.93 33.93.23 93.23.13 23.13.33 13.33.3 33.3.33 3.33.83 33.83.74 83.74.74 74.74.54 74.54.84 54.84.74 84.74.24 74.24.4 24.4.94 4.94.84 94.84.74 84.74.34 74.34.34 34.34.44 34.44.74 44.74.64 74.64.14 64.14.34 14.34.84 34.84.84 84.84.44 84.44.34 44.34.65 34.65.35 65.35.85 35.85.85 85.85.55 85.55.15 55.15.25 15.25.75 25.75.95 75.95.65 95.65.65 65.65.35 65.35.5 35.5.15 5.15.95 15.95.55 95.55.75 55.75.85 75.85.75 85.75.15 75.15.95 15.95.5 95.5.26 5.26.96 26.96.46 96.46.6 46.6.46 6.46.16 46.16.16 16.16.86 16.86.56 86.56.56 56.56.56 56.56.16 56.16.36 16.36.76 36.76.96 76.96.96 96.96.26 96.26.26 26.26.36 26.36.66 36.66.36 66.36.36 36.36.97 36.97.27 97.27.97 27.97.67 97.67.77 67.77.47 77.47.7 47.7.47 7.47.87 47.87.37 87.37.87 37.87.77 87.77.7 77.7.57 7.57.47 57.47.47 47.47.37 47.37.27 37.27.17 27.17.7 17.7.38 7.38.68 38.68.78 68.78.8 78.8.28 8.28.98 28.98.78 98.78.58 78.58.98 58.98.8 98.8.88 8.88.8 88.8.58 8.58.58 58.58.58 58.58.38 58.38.99 38.99.89 99.89.59 89.59.39 59.39.99 39.99.29 99.29.59 29.59.89 59.89.89 89.89.29 89.29.9 29.9.79 9.79.49 79.49.59 49.59.29 59.29.59 29.59.19 59.19.39 19.39.9 39.9.9 9.9.99}
do_execsql_test 1.6.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.6.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING)
} {0 {} 0 {} 1 {} 2 74 3 74 3 74.74 3 74 3 74.99 3 99 3 99.33 3 33 3 33.89 3 89 3 89.96 3 96 3 96.38 3 38 3 38.39 3 39 3 39.91 3 91 3 91.6 3 6 3 6.97 3 97 3 97.46 3 46 3 46.54 3 54 3 54.8 3 8 3 8.29 3 29 3 29.84 3 84 3 84.23 3 23 3 23.16 3 16 3 16.65 3 65 3 65.47 3 47 3 47.86 3 86 3 86.61 3 61 3 61.85 3 85 3 85.85 3 85 3 85.59 3 59 3 59.32 3 32 3 32.3 3 3 3 3.22 3 22 3 22.55 3 55 3 55.28 3 28 3 28.25 3 25 3 25.1 3 1 3 1.40 3 40 3 40.56 3 56 3 56.75 3 75 3 75.89 3 89 3 89.76 3 76 3 76.4 3 4 3 4.42 3 42 3 42.78 3 78 3 78.29 3 29 3 29.63 3 63 3 63.87 3 87 3 87.80 3 80 3 80.72 3 72 3 72.9 3 9 3 9.73 3 73 3 73.65 3 65 3 65.58 3 58 3 58.98 3 98 3 98.21 3 21 3 21.65 3 65 3 65.5 3 5 3 5.11 3 11 3 11.87 3 87 3 87.12 3 12 3 12.20 3 20 3 20.31 3 31 3 31.95 3 95 3 95.73 3 73 3 73.88 3 88 3 88.8 3 8 3 8.49 3 49 3 49.90 3 90 3 90.96 3 96 3 96.55 3 55 3 55.77 3 77 3 77.2 3 2 3 2.85 3 85 3 85.74 3 74 3 74.70 3 70 3 70.19 3 19 3 19.26 3 26 3 26.47 3 47 3 47.90 3 90 3 90.58 3 58 3 58.9 3 9 3 9.72 3 72 3 72.33 3 33 3 33.75 3 75 3 75.81 3 81 3 81.23 3 23 3 23.13 3 13 3 13.14 3 14 3 14.91 3 91 3 91.91 3 91 3 91.15 3 15 3 15.36 3 36 3 36.3 3 3 3 3.69 3 69 3 69.52 3 52 3 52.50 3 50 3 50.10 3 10 3 10.33 3 33 3 33.39 3 39 3 39.58 3 58 3 58.38 3 38 3 38.83 3 83 3 83.82 3 82}
do_execsql_test 1.6.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING)
} {0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {}}
do_execsql_test 1.6.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING)
} {0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {}}
do_execsql_test 1.6.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 PRECEDING)
} {0 {} 0 {} 1 89 2 89.6 3 89.6.29 3 6.29.47 3 29.47.59 3 47.59.28 3 59.28.75 3 28.75.78 3 75.78.72 3 78.72.98 3 72.98.87 3 98.87.73 3 87.73.96 3 73.96.74 3 96.74.90 3 74.90.75 3 90.75.91 3 75.91.69 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 74 2 74.96 3 74.96.97 3 96.97.84 3 97.84.86 3 84.86.32 3 86.32.25 3 32.25.89 3 25.89.29 3 89.29.9 3 29.9.21 3 9.21.12 3 21.12.88 3 12.88.55 3 88.55.70 3 55.70.58 3 70.58.81 3 58.81.91 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 74 2 74.38 3 74.38.46 3 38.46.23 3 46.23.61 3 23.61.3 3 61.3.1 3 3.1.76 3 1.76.63 3 76.63.73 3 63.73.65 3 73.65.20 3 65.20.8 3 20.8.77 3 8.77.19 3 77.19.9 3 19.9.23 3 9.23.15 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 99 2 99.39 3 99.39.54 3 39.54.16 3 54.16.85 3 16.85.22 3 85.22.40 3 22.40.4 3 40.4.87 3 4.87.65 3 87.65.5 3 65.5.31 3 5.31.49 3 31.49.2 3 49.2.26 3 2.26.72 3 26.72.13 3 72.13.36 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 0 {} 0 {} 1 33 2 33.91 3 33.91.8 3 91.8.65 3 8.65.85 3 65.85.55 3 85.55.56 3 55.56.42 3 56.42.80 3 42.80.58 3 80.58.11 3 58.11.95 3 11.95.90 3 95.90.85 3 90.85.47 3 85.47.33 3 47.33.14 3 33.14.3 0 {} 0 {} 1 {} 2 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {}}
do_execsql_test 1.7.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 74 74 74 74 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.7.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.7.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.7.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.7.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.7.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.7.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.7.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.7.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.7.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.7.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.7.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.7.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.7.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.7.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.7.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.7.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.7.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.7.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.7.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.7.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 76 44 78 28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206}
do_execsql_test 1.7.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.7.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 65 102 11 87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276}
do_execsql_test 1.7.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 196 134 109 213 223 106 234 191 212 168 229 147 218 240 65 102 119 136 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 11 87 138 63 124 179 78 141 84 120 234 79 231 162 227 228 280 57 181 110 179 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 80 182 71 157 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 111 206 74 132 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 26 51 52 85 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 48 144 207 216 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 36 121 132 88 52 232 156 210 239 250 83 103 158 210 171 198 101 163 172 163 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276}
do_execsql_test 1.7.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.7.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.7.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} 41 {} {} {} {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} 2 {} 29 {} {} {} 46 62 62 {} {} 16 {} 33 {} {} {} {} {} 78 {} 61 {} 59 77 {} 74 {} 27 {} 22 39 67 {} 54 85 74 90 7 61 90 62 {} 93 {} {} {} {} 23 {} 74 93 30 23 29 3 1 41 {} 65 33 2 98 86 89 25 76 {} 40 38 15 13 96 74 97 81 40 16 99 76 96 32 80 86 59 2 99 84 84 39 65 27 76 78 84 16 2 96 59 16 41 28 13 89 22 4 42 91 41 33 87 55 81 29 36 28 6 47 97 97 85 33 41 93 15 85 89 98 98 43 23 73 4 56 29 89 46 65 38 59 68 47 9 93 9 23 39 16 93 98 74 65 75 15 56 93 12 2 81 2 23 97 47 91 15 93 35 16 63 8 53 91 33 99}
do_execsql_test 1.7.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} 81 {} {} {} 81 {} 21 {} {} {} {} 21 {} {} {} 21 {} {} {} {} {} {} 12 {} {} {} 12 {} {} 72 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 73 {} 23 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} 64 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 15 {} {} {} {} {} {} 55 {} 15 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 47 {} {} {} {} {} {} {} {} {} 98 {} 98 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 29 {} {} {} {} {} {} {} 29 29 {} {} {}}
do_execsql_test 1.7.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 4 4 5 5 5 5 6 6 7 7 7 7 7 7 8 8 8 8 8 8 8 9 9 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 17 17 17 17 19 19 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 25 25 25 25 26 26 27 27 28 29 29 29 29 29 29 30 30 30 30 30 30 30 30 30 31 31 31 32 32 33 33 33 33 33 33 33 34 34 34 35 35 35 35 35 35 36 36 36 36 36 36 36 36 36 36 36 37 37 37 38 38 38 38 38 39 39 39 39 39 39 40 40 40 41 41 41 41 42 42 42 43 43 43 43 43 43 43 43 44 44 44 46 46 46 46 47 47 47 47 47 47 47 47 47 47}
do_execsql_test 1.7.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} 90 {} {} {} 90 1 30 {} {} {} 31 30 {} {} {} 1 40 {} 50 11 81 42 40 {} 50 81 40 {} {} 50 {} 52 {} 41 81 {} 41 {} 2 30 2 81 82 53 {} 10 {} {} 81 {} 41 10 81 30 81 {} 3 3 23 {} 3 61 80 {} 94 3 91 91 72 3 63 30 91 94 94 72 91 73 91 84 84 33 41 1 33 84 73 73 91 20 41 84 33 33 84 33 41 84 20 21 44 22 90 22 81 81 74 93 93 93 81 21 83 44 44 21 21 21 13 21 21 34 11 34 73 74 2 60 2 34 2 34 74 60 23 2 2 2 11 91 60 62 73 74 70 51 65 74 93 65 70 34 70 93 93 93 62 35 44 43 12 35 41 43 44 44 41 80 54 72 43 41 43 91 12 80 80 35 33 12}
do_execsql_test 1.7.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.7.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.7.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.7.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9}
do_execsql_test 1.7.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.7.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.7.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.7.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.7.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.7.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.7.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.7.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 0.74 0.74.41 0.74.41.74 0.74.41.74.23 0.74.41.74.23.99 0.74.41.74.23.99.26 0.74.41.74.23.99.26.33 0.74.41.74.23.99.26.33.2 0.74.41.74.23.99.26.33.2.89 0.74.41.74.23.99.26.33.2.89.81 0.74.41.74.23.99.26.33.2.89.81.96 0.74.41.74.23.99.26.33.2.89.81.96.59 0.74.41.74.23.99.26.33.2.89.81.96.59.38 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32 0.74.41.74.23.99.26.
do_execsql_test 1.7.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 0.90 0.90.40 0.90.40.30 0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 0.90.40.30.80.20.90.60 0.90.40.30.80.20.90.60.70 0.90.40.30.80.20.90.60.70.80 0.90.40.30.80.20.90.60.70.80.90 0.90.40.30.80.20.90.60.70.80.90.30 0.90.40.30.80.20.90.60.70.80.90.30.50 0.90.40.30.80.20.90.60.70.80.90.30.50.10 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 41 41.81 41.81.91 41.81.91.61 41.81.91.61.91 41.81.91.61.91.91 41.81.91.61.91.91.1 41.81.91.61.91.91.1.81 41.81.91.61.91.91.1.81.41 41.81.91.61.91.91.1.81.41.61 41.81.91.61.91.91.1.81.41.61.1 41.81.91.61.91.91.1.81.41.61.1.21 41.81.91.61.91.91.1.81.41.61.1.21.11 41.81.91.61.91.91.1.81.41.61.1.21.11.51 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 2 2.62 2.62.12 2.62.12.32 2.62.12.32.22 2.62.12.32.22.42 2.62.12.32.22.42.2 2.62.12.32.22.42.2.72 2.62.12.32.22.42.2.72.12 2.62.12.32.22.42.2.72.12.22 2.62.12.32.22.42.2.72.12.22.2 2.62.12.32.22.42.2.72.12.22.2.72 2.62.12.32.22.42.2.72.12.22.2.72.72 2.62.12.32.22.42.2.72.12.22.2.72.72.12 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 23 23.33 23.33.93 23.33.93.23 23.33.93.23.93 23.33.93.23.93.43 23.33.93.23.93.43.3 23.33.93.23.93.43.3.43 23.33.93.23.93.43.3.43.33 23.33.93.23.93.43.3.43.33.53 23.33.93.23.93.43.3.43.33.53.63 23.33.93.23.93.43.3.43.33.53.63.73 23.33.93.23.93.43.3.43.33.53.63.73.13 23.33.93.23.93.43.3.43.33.53.63.73.13.73 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 74 74.74 74.74.54 74.74.54.84 74.74.54.84.74 74.74.54.84.74.24 74.74.54.84.74.24.4 74.74.54.84.74.24.4.94 74.74.54.84.74.24.4.94.84 74.74.54.84.74.24.4.94.84.74 74.74.54.84.74.24.4.94.84.74.34 74.74.54.84.74.24.4.94.84.74.34.34 74.74.54.84.74.24.4.94.84.74.34.34.44 74.74.54.84.74.24.4.94.84.74.34.34.44.74 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 65 65.35 65.35.85 65.35.85.85 65.35.85.85.55 65.35.85.85.55.15 65.35.85.85.55.15.25 65.35.85.85.55.15.25.75 65.35.85.85.55.15.25.75.95 65.35.85.85.55.15.25.75.95.65 65.35.85.85.55.15.25.75.95.65.65 65.35.85.85.55.15.25.75.95.65.65.35 65.35.85.85.55.15.25.75.95.65.65.35.5 65.35.85.85.55.15.25.75.95.65.65.35.5.15 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 26 26.96 26.96.46 26.96.46.6 26.96.46.6.46 26.96.46.6.46.16 26.96.46.6.46.16.16 26.96.46.6.46.16.16.86
do_execsql_test 1.7.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.1 0.1.1 0.1.1.2 0.1.1.2.2 0.1.1.2.2.2 0.1.1.2.2.2.3 0.1.1.2.2.2.3.3 0.1.1.2.2.2.3.3.4 0.1.1.2.2.2.3.3.4.5 0.1.1.2.2.2.3.3.4.5.5 0.1.1.2.2.2.3.3.4.5.5.6 0.1.1.2.2.2.3.3.4.5.5.6.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29 0.1.1.
do_execsql_test 1.7.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.10 0.10.20 0.10.20.30 0.10.20.30.30 0.10.20.30.30.30 0.10.20.30.30.30.40 0.10.20.30.30.30.40.50 0.10.20.30.30.30.40.50.60 0.10.20.30.30.30.40.50.60.70 0.10.20.30.30.30.40.50.60.70.80 0.10.20.30.30.30.40.50.60.70.80.80 0.10.20.30.30.30.40.50.60.70.80.80.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 1 1.1 1.1.11 1.1.11.11 1.1.11.11.21 1.1.11.11.21.21 1.1.11.11.21.21.31 1.1.11.11.21.21.31.31 1.1.11.11.21.21.31.31.41 1.1.11.11.21.21.31.31.41.41 1.1.11.11.21.21.31.31.41.41.41 1.1.11.11.21.21.31.31.41.41.41.51 1.1.11.11.21.21.31.31.41.41.41.51.61 1.1.11.11.21.21.31.31.41.41.41.51.61.61 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 2 2.2 2.2.2 2.2.2.12 2.2.2.12.12 2.2.2.12.12.12 2.2.2.12.12.12.22 2.2.2.12.12.12.22.22 2.2.2.12.12.12.22.22.32 2.2.2.12.12.12.22.22.32.42 2.2.2.12.12.12.22.22.32.42.52 2.2.2.12.12.12.22.22.32.42.52.62 2.2.2.12.12.12.22.22.32.42.52.62.62 2.2.2.12.12.12.22.22.32.42.52.62.62.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 3 3.3 3.3.13 3.3.13.13 3.3.13.13.23 3.3.13.13.23.23 3.3.13.13.23.23.23 3.3.13.13.23.23.23.33 3.3.13.13.23.23.23.33.33 3.3.13.13.23.23.23.33.33.33 3.3.13.13.23.23.23.33.33.33.33 3.3.13.13.23.23.23.33.33.33.33.33 3.3.13.13.23.23.23.33.33.33.33.33.43 3.3.13.13.23.23.23.33.33.33.33.33.43.43 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 4 4.14 4.14.24 4.14.24.34 4.14.24.34.34 4.14.24.34.34.34 4.14.24.34.34.34.34 4.14.24.34.34.34.34.44 4.14.24.34.34.34.34.44.44 4.14.24.34.34.34.34.44.44.54 4.14.24.34.34.34.34.44.44.54.64 4.14.24.34.34.34.34.44.44.54.64.74 4.14.24.34.34.34.34.44.44.54.64.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 5 5.5 5.5.15 5.5.15.15 5.5.15.15.15 5.5.15.15.15.25 5.5.15.15.15.25.35 5.5.15.15.15.25.35.35 5.5.15.15.15.25.35.35.55 5.5.15.15.15.25.35.35.55.55 5.5.15.15.15.25.35.35.55.55.65 5.5.15.15.15.25.35.35.55.55.65.65 5.5.15.15.15.25.35.35.55.55.65.65.65 5.5.15.15.15.25.35.35.55.55.65.65.65.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 6 6.16 6.16.16 6.16.16.16 6.16.16.16.26 6.16.16.16.26.26 6.16.16.16.26.26.26 6.16.16.16.26.26.26.36 6.16.16.16.26.26.26.36.36 6.16.16.16.26.26.26.36.36.36 6.16.16.16.26.26.26.36.36.36.36
do_execsql_test 1.7.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.90 0.90.40 0.90.40.30 0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 0.90.40.30.80.20.90.60 0.90.40.30.80.20.90.60.70 0.90.40.30.80.20.90.60.70.80 0.90.40.30.80.20.90.60.70.80.90 0.90.40.30.80.20.90.60.70.80.90.30 0.90.40.30.80.20.90.60.70.80.90.30.50 0.90.40.30.80.20.90.60.70.80.90.30.50.10 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.1
do_execsql_test 1.7.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.7.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
} {1 {} 2 74 3 74 4 74.74 5 74.74 6 74.74.99 7 74.74.99 8 74.74.99.33 9 74.74.99.33 10 74.74.99.33.89 11 74.74.99.33.89 12 74.74.99.33.89.96 13 74.74.99.33.89.96 14 74.74.99.33.89.96.38 15 74.74.99.33.89.96.38 16 74.74.99.33.89.96.38.39 17 74.74.99.33.89.96.38.39 18 74.74.99.33.89.96.38.39.91 19 74.74.99.33.89.96.38.39.91 20 74.74.99.33.89.96.38.39.91.6 21 74.74.99.33.89.96.38.39.91.6 22 74.74.99.33.89.96.38.39.91.6.97 23 74.74.99.33.89.96.38.39.91.6.97 24 74.74.99.33.89.96.38.39.91.6.97.46 25 74.74.99.33.89.96.38.39.91.6.97.46 26 74.74.99.33.89.96.38.39.91.6.97.46.54 27 74.74.99.33.89.96.38.39.91.6.97.46.54 28 74.74.99.33.89.96.38.39.91.6.97.46.54.8 29 74.74.99.33.89.96.38.39.91.6.97.46.54.8 30 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29 31 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29 32 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84 33 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84 34 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23 35 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23 36 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16 37 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16 38 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65 39 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65 40 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47 41 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47 42 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86 43 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86 44 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61 45 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61 46 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85 47 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85 48 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85 49 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85 50 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59 51 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59 52 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32 53 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32 54 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3 55 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3 56 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22 57 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22 58 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55 59 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55 60 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28 61 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28 62 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25 63 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25 64 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1 65 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1 66 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40 67 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40 68 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56 69 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56 70 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75 71 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75 72 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.5
do_execsql_test 1.7.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
} {1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 22 {} 23 {} 24 {} 25 {} 26 {} 27 {} 28 {} 29 {} 30 {} 31 {} 32 {} 33 {} 34 {} 35 {} 36 {} 37 {} 38 {} 39 {} 40 {} 41 {} 42 {} 43 {} 44 {} 45 {} 46 {} 47 {} 48 {} 49 {} 50 {} 51 {} 52 {} 53 {} 54 {} 55 {} 56 {} 57 {} 58 {} 59 {} 60 {} 61 {} 62 {} 63 {} 64 {} 65 {} 66 {} 67 {} 68 {} 69 {} 70 {} 71 {} 72 {} 73 {} 74 {} 75 {} 76 {} 77 {} 78 {} 79 {} 80 {} 81 {} 82 {} 83 {} 84 {} 85 {} 86 {} 87 {} 88 {} 89 {} 90 {} 91 {} 92 {} 93 {} 94 {} 95 {} 96 {} 97 {} 98 {} 99 {} 100 {} 101 {} 102 {} 103 {} 104 {} 105 {} 106 {} 107 {} 108 {} 109 {} 110 {} 111 {} 112 {} 113 {} 114 {} 115 {} 116 {} 117 {} 118 {} 119 {} 120 {} 121 {} 122 {} 123 {} 124 {} 125 {} 126 {} 127 {} 128 {} 129 {} 130 {} 131 {} 132 {} 133 {} 134 {} 135 {} 136 {} 137 {} 138 {} 139 {} 140 {} 141 {} 142 {} 143 {} 144 {} 145 {} 146 {} 147 {} 148 {} 149 {} 150 {} 151 {} 152 {} 153 {} 154 {} 155 {} 156 {} 157 {} 158 {} 159 {} 160 {} 161 {} 162 {} 163 {} 164 {} 165 {} 166 {} 167 {} 168 {} 169 {} 170 {} 171 {} 172 {} 173 {} 174 {} 175 {} 176 {} 177 {} 178 {} 179 {} 180 {} 181 {} 182 {} 183 {} 184 {} 185 {} 186 {} 187 {} 188 {} 189 {} 190 {} 191 {} 192 {} 193 {} 194 {} 195 {} 196 {} 197 {} 198 {} 199 {} 200 {} 201 {}}
do_execsql_test 1.7.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
} {1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {}}
do_execsql_test 1.7.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
} {1 89 2 89.6 3 89.6.29 4 89.6.29.47 5 89.6.29.47.59 6 89.6.29.47.59.28 7 89.6.29.47.59.28.75 8 89.6.29.47.59.28.75.78 9 89.6.29.47.59.28.75.78.72 10 89.6.29.47.59.28.75.78.72.98 11 89.6.29.47.59.28.75.78.72.98.87 12 89.6.29.47.59.28.75.78.72.98.87.73 13 89.6.29.47.59.28.75.78.72.98.87.73.96 14 89.6.29.47.59.28.75.78.72.98.87.73.96.74 15 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90 16 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75 17 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91 18 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69 19 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 1 74 2 74.96 3 74.96.97 4 74.96.97.84 5 74.96.97.84.86 6 74.96.97.84.86.32 7 74.96.97.84.86.32.25 8 74.96.97.84.86.32.25.89 9 74.96.97.84.86.32.25.89.29 10 74.96.97.84.86.32.25.89.29.9 11 74.96.97.84.86.32.25.89.29.9.21 12 74.96.97.84.86.32.25.89.29.9.21.12 13 74.96.97.84.86.32.25.89.29.9.21.12.88 14 74.96.97.84.86.32.25.89.29.9.21.12.88.55 15 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70 16 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58 17 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81 18 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91 19 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 74 2 74.38 3 74.38.46 4 74.38.46.23 5 74.38.46.23.61 6 74.38.46.23.61.3 7 74.38.46.23.61.3.1 8 74.38.46.23.61.3.1.76 9 74.38.46.23.61.3.1.76.63 10 74.38.46.23.61.3.1.76.63.73 11 74.38.46.23.61.3.1.76.63.73.65 12 74.38.46.23.61.3.1.76.63.73.65.20 13 74.38.46.23.61.3.1.76.63.73.65.20.8 14 74.38.46.23.61.3.1.76.63.73.65.20.8.77 15 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19 16 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9 17 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23 18 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15 19 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 99 2 99.39 3 99.39.54 4 99.39.54.16 5 99.39.54.16.85 6 99.39.54.16.85.22 7 99.39.54.16.85.22.40 8 99.39.54.16.85.22.40.4 9 99.39.54.16.85.22.40.4.87 10 99.39.54.16.85.22.40.4.87.65 11 99.39.54.16.85.22.40.4.87.65.5 12 99.39.54.16.85.22.40.4.87.65.5.31 13 99.39.54.16.85.22.40.4.87.65.5.31.49 14 99.39.54.16.85.22.40.4.87.65.5.31.49.2 15 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26 16 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72 17 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13 18 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36 19 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 1 {} 2 {} 3 {} 4 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 1 33 2 33.91 3 33.91.8 4 33.91.8.65 5 33.91.8.65.85 6 33.91.8.65.85.55 7 33.91.8.65.85.55.56 8 33.91.8.65.85.55.56.42 9 33.91.8.65.85.55.56.42.80 10 33.91.8.65.85.55.56.42.80.58 11 33.91.8.65.85.55.56.42.80.58.11 12 33.91.8.65.85.55.56.42.80.58.11.95 13 33.91.8.65.85.55.56.42.80.58.11.95.90 14 33.91.8.65.85.55.56.42.80.58.11.95.90.85 15 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47 16 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33 17 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14 18 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3 19 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33 20 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82
do_execsql_test 1.8.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 74 74 74 74 99 99 99 99 99 89 96 96 96 96 96 68 91 91 91 99 99 99 99 99 97 97 97 97 97 97 93 93 93 93 84 93 93 93 93 93 86 86 86 91 91 91 91 91 85 85 85 59 59 91 91 91 91 91 90 90 89 89 89 89 56 56 56 56 75 75 89 98 98 98 98 98 94 94 94 94 78 78 78 63 87 87 87 87 87 84 84 84 73 95 95 95 95 96 98 98 98 98 98 74 74 74 73 73 87 87 87 87 87 41 31 31 95 95 95 95 95 88 88 88 88 49 90 90 96 96 96 96 96 77 77 77 85 85 85 85 85 74 74 70 70 59 47 80 90 90 90 90 90 72 72 72 72 93 93 93 93 93 81 81 81 37 37 62 91 91 91 91 91 91 91 99 99 99 99 99 95 95 69 84 84 84 84 84 84 84 58 58 58 58 83 83 83 83 83 82}
do_execsql_test 1.8.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 23 23 23 2 2 2 2 2 38 38 38 38 38 39 6 6 6 6 6 27 27 27 8 8 8 8 8 29 23 16 16 16 16 16 16 7 7 7 7 7 61 24 24 24 24 12 12 12 3 3 3 3 3 15 15 15 15 15 1 1 1 1 1 16 16 16 16 16 36 36 4 4 4 4 4 30 29 29 29 2 2 2 2 2 37 37 9 9 9 9 9 13 13 13 13 1 1 1 1 1 5 5 5 5 5 11 11 8 8 8 8 8 15 15 15 15 22 22 8 8 8 8 8 11 34 34 55 55 55 44 2 2 2 2 2 7 29 29 19 19 19 19 19 26 26 26 36 36 9 9 9 9 9 33 33 33 33 9 9 9 9 9 12 12 12 12 14 33 15 15 15 15 3 3 3 3 3 30 30 30 10 10 10 10 10 21 21 21 30 30 30 27 27 17 7 5}
do_execsql_test 1.8.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.8.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.8.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.8.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.8.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.8.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.8.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.8.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.8.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.8.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.8.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.8.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.8.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.8.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.8.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.8.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.8.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.8.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.8.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 76 44 78 28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206}
do_execsql_test 1.8.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.8.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 65 102 11 87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276}
do_execsql_test 1.8.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 196 134 109 213 223 106 234 191 212 168 229 147 218 240 65 102 119 136 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 11 87 138 63 124 179 78 141 84 120 234 79 231 162 227 228 280 57 181 110 179 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 80 182 71 157 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 111 206 74 132 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 26 51 52 85 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 48 144 207 216 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 36 121 132 88 52 232 156 210 239 250 83 103 158 210 171 198 101 163 172 163 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276}
do_execsql_test 1.8.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.8.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.8.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 56 {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} {} {} {} {} 4 {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 77 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 22 {} {} {} 12 {} {} {} {} {} {} {} {} {} {} {} {} 43 {} {} {} {} {} {} {} {} {} {} {} {} {} 33 {} {} {} {} {} {} {} {} 4 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 1 1 1 1 2 2 3 4 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 81 {} {} {} {} {} {} {} {} {} {} {} 91 {} {} {} {} {} 22 {} {} {} 12 {} {} {} {} {} {} {} {} {} {} {} {} 43 {} {} {} {} {} {} {} {} {} {} {} {} {} 33 {} {} {} {} {} {} {} {} 4 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 0 0 0 0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27}
do_execsql_test 1.8.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 0 0 0 0 90 40 30 80 20 90 60 70 80 90 41 41 41 41 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 2 2 2 2 2 62 12 32 22 42 2 72 12 22 2 72 72 23 23 23 23 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 74 74 74 74 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 65 65 65 65 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 26 26 26 26 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 97 97 97 97 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 38 38 38 38 38 68 78 8 28 98 78 58 98 8 88 8 99 99 99 99 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9}
do_execsql_test 1.8.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98}
do_execsql_test 1.8.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 10 20 30 30 30 40 50 60 70 80 1 1 1 1 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 2 2 2 2 2 2 2 12 12 12 22 22 32 42 52 62 62 3 3 3 3 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 4 4 4 4 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 5 5 5 5 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 6 6 6 6 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 7 7 7 7 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 8 8 8 8 8 8 8 28 38 38 58 58 58 58 68 78 9 9 9 9 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89}
do_execsql_test 1.8.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 0 0 0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9}
do_execsql_test 1.8.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.8.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.8.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.8.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.8.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.8.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.8.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 0.74 0.74.41 0.74.41.74 0.74.41.74.23 74.41.74.23.99 41.74.23.99.26 74.23.99.26.33 23.99.26.33.2 99.26.33.2.89 26.33.2.89.81 33.2.89.81.96 2.89.81.96.59 89.81.96.59.38 81.96.59.38.68 96.59.38.68.39 59.38.68.39.62 38.68.39.62.91 68.39.62.91.46 39.62.91.46.6 62.91.46.6.99 91.46.6.99.97 46.6.99.97.27 6.99.97.27.46 99.97.27.46.78 97.27.46.78.54 27.46.78.54.97 46.78.54.97.8 78.54.97.8.67 54.97.8.67.29 97.8.67.29.93 8.67.29.93.84 67.29.93.84.77 29.93.84.77.23 93.84.77.23.16 84.77.23.16.16 77.23.16.16.93 23.16.16.93.65 16.16.93.65.35 16.93.65.35.47 93.65.35.47.7 65.35.47.7.86 35.47.7.86.74 47.7.86.74.61 7.86.74.61.91 86.74.61.91.85 74.61.91.85.24 61.91.85.24.85 91.85.24.85.43 85.24.85.43.59 24.85.43.59.12 85.43.59.12.32 43.59.12.32.56 59.12.32.56.3 12.32.56.3.91 32.56.3.91.22 56.3.91.22.90 3.91.22.90.55 91.22.90.55.15 22.90.55.15.28 90.55.15.28.89 55.15.28.89.25 15.28.89.25.47 28.89.25.47.1 89.25.47.1.56 25.47.1.56.40 47.1.56.40.43 1.56.40.43.56 56.40.43.56.16 40.43.56.16.75 43.56.16.75.36 56.16.75.36.89 16.75.36.89.98 75.36.89.98.76 36.89.98.76.81 89.98.76.81.4 98.76.81.4.94 76.81.4.94.42 81.4.94.42.30 4.94.42.30.78 94.42.30.78.33 42.30.78.33.29 30.78.33.29.53 78.33.29.53.63 33.29.53.63.2 29.53.63.2.87 53.63.2.87.37 63.2.87.37.80 2.87.37.80.84 87.37.80.84.72 37.80.84.72.41 80.84.72.41.9 84.72.41.9.61 72.41.9.61.73 41.9.61.73.95 9.61.73.95.65 61.73.95.65.13 73.95.65.13.58 95.65.13.58.96 65.13.58.96.98 13.58.96.98.1 58.96.98.1.21 96.98.1.21.74 98.1.21.74.65 1.21.74.65.35 21.74.65.35.5 74.65.35.5.73 65.35.5.73.11 35.5.73.11.51 5.73.11.51.87 73.11.51.87.41 11.51.87.41.12 51.87.41.12.8 87.41.12.8.20 41.12.8.20.31 12.8.20.31.31 8.20.31.31.15 20.31.31.15.95 31.31.15.95.22 31.15.95.22.73 15.95.22.73.79 95.22.73.79.88 22.73.79.88.34 73.79.88.34.8 79.88.34.8.11 88.34.8.11.49 34.8.11.49.34 8.11.49.34.90 11.49.34.90.59 49.34.90.59.96 34.90.59.96.60 90.59.96.60.55 59.96.60.55.75 96.60.55.75.77 60.55.75.77.44 55.75.77.44.2 75.77.44.2.7 77.44.2.7.85 44.2.7.85.57 2.7.85.57.74 7.85.57.74.29 85.57.74.29.70 57.74.29.70.59 74.29.70.59.19 29.70.59.19.39 70.59.19.39.26 59.19.39.26.26 19.39.26.26.47 39.26.26.47.80 26.26.47.80.90 26.47.80.90.36 47.80.90.36.58 80.90.36.58.47 90.36.58.47.9 36.58.47.9.72 58.47.9.72.72 47.9.72.72.66 9.72.72.66.33 72.72.66.33.93 72.66.33.93.75 66.33.93.75.64 33.93.75.64.81 93.75.64.81.9 75.64.81.9.23 64.81.9.23.37 81.9.23.37.13 9.23.37.13.12 23.37.13.12.14 37.13.12.14.62 13.12.14.62.91 12.14.62.91.36 14.62.91.36.91 62.91.36.91.33 91.36.91.33.15 36.91.33.15.34 91.33.15.34.36 33.15.34.36.99 15.34.36.99.3 34.36.99.3.95 36.99.3.95.69 99.3.95.69.58 3.95.69.58.52 95.69.58.52.30 69.58.52.30.50 58.52.30.50.84 52.30.50.84.10 30.50.84.10.84 50.84.10.84.33 84.10.84.33.21 10.84.33.21.39 84.33.21.39.44 33.21.39.44.58 21.39.44.58.30 39.44.58.30.38 44.58.30.38.34 58.30.38.34.83 30.38.34.83.27 38.34.83.27.82 34.83.27.82.17 83.27.82.17.7 27.82.17.7.5}
do_execsql_test 1.8.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 0.90 0.90.40 0.90.40.30 0.90.40.30.80 90.40.30.80.20 40.30.80.20.90 30.80.20.90.60 80.20.90.60.70 20.90.60.70.80 90.60.70.80.90 60.70.80.90.30 70.80.90.30.50 80.90.30.50.10 90.30.50.10.30 41 41.81 41.81.91 41.81.91.61 41.81.91.61.91 81.91.61.91.91 91.61.91.91.1 61.91.91.1.81 91.91.1.81.41 91.1.81.41.61 1.81.41.61.1 81.41.61.1.21 41.61.1.21.11 61.1.21.11.51 1.21.11.51.41 21.11.51.41.31 11.51.41.31.31 51.41.31.31.11 41.31.31.11.81 31.31.11.81.91 31.11.81.91.91 11.81.91.91.21 2 2.62 2.62.12 2.62.12.32 2.62.12.32.22 62.12.32.22.42 12.32.22.42.2 32.22.42.2.72 22.42.2.72.12 42.2.72.12.22 2.72.12.22.2 72.12.22.2.72 12.22.2.72.72 22.2.72.72.12 2.72.72.12.62 72.72.12.62.52 72.12.62.52.82 23 23.33 23.33.93 23.33.93.23 23.33.93.23.93 33.93.23.93.43 93.23.93.43.3 23.93.43.3.43 93.43.3.43.33 43.3.43.33.53 3.43.33.53.63 43.33.53.63.73 33.53.63.73.13 53.63.73.13.73 63.73.13.73.73 73.13.73.73.33 13.73.73.33.93 73.73.33.93.23 73.33.93.23.13 33.93.23.13.33 93.23.13.33.3 23.13.33.3.33 13.33.3.33.83 74 74.74 74.74.54 74.74.54.84 74.74.54.84.74 74.54.84.74.24 54.84.74.24.4 84.74.24.4.94 74.24.4.94.84 24.4.94.84.74 4.94.84.74.34 94.84.74.34.34 84.74.34.34.44 74.34.34.44.74 34.34.44.74.64 34.44.74.64.14 44.74.64.14.34 74.64.14.34.84 64.14.34.84.84 14.34.84.84.44 34.84.84.44.34 65 65.35 65.35.85 65.35.85.85 65.35.85.85.55 35.85.85.55.15 85.85.55.15.25 85.55.15.25.75 55.15.25.75.95 15.25.75.95.65 25.75.95.65.65 75.95.65.65.35 95.65.65.35.5 65.65.35.5.15 65.35.5.15.95 35.5.15.95.55 5.15.95.55.75 15.95.55.75.85 95.55.75.85.75 55.75.85.75.15 75.85.75.15.95 85.75.15.95.5 26 26.96 26.96.46 26.96.46.6 26.96.46.6.46 96.46.6.46.16 46.6.46.16.16 6.46.16.16.86 46.16.16.86.56 16.16.86.56.56 16.86.56.56.56 86.56.56.56.16 56.56.56.16.36 56.56.16.36.76 56.16.36.76.96 16.36.76.96.96 36.76.96.96.26 76.96.96.26.26 96.96.26.26.36 96.26.26.36.66 26.26.36.66.36 26.36.66.36.36 97 97.27 97.27.97 97.27.97.67 97.27.97.67.77 27.97.67.77.47 97.67.77.47.7 67.77.47.7.47 77.47.7.47.87 47.7.47.87.37 7.47.87.37.87 47.87.37.87.77 87.37.87.77.7 37.87.77.7.57 87.77.7.57.47 77.7.57.47.47 7.57.47.47.37 57.47.47.37.27 47.47.37.27.17 47.37.27.17.7 38 38.68 38.68.78 38.68.78.8 38.68.78.8.28 68.78.8.28.98 78.8.28.98.78 8.28.98.78.58 28.98.78.58.98 98.78.58.98.8 78.58.98.8.88 58.98.8.88.8 98.8.88.8.58 8.88.8.58.58 88.8.58.58.58 8.58.58.58.38 99 99.89 99.89.59 99.89.59.39 99.89.59.39.99 89.59.39.99.29 59.39.99.29.59 39.99.29.59.89 99.29.59.89.89 29.59.89.89.29 59.89.89.29.9 89.89.29.9.79 89.29.9.79.49 29.9.79.49.59 9.79.49.59.29 79.49.59.29.59 49.59.29.59.19 59.29.59.19.39 29.59.19.39.9 59.19.39.9.9 19.39.9.9.99 39.9.9.99.69 9.9.99.69.39}
do_execsql_test 1.8.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.1 0.1.1 0.1.1.2 0.1.1.2.2 1.1.2.2.2 1.2.2.2.3 2.2.2.3.3 2.2.3.3.4 2.3.3.4.5 3.3.4.5.5 3.4.5.5.6 4.5.5.6.7 5.5.6.7.7 5.6.7.7.7 6.7.7.7.8 7.7.7.8.8 7.7.8.8.8 7.8.8.8.9 8.8.8.9.9 8.8.9.9.9 8.9.9.9.10 9.9.9.10.11 9.9.10.11.11 9.10.11.11.12 10.11.11.12.12 11.11.12.12.12 11.12.12.12.13 12.12.12.13.13 12.12.13.13.14 12.13.13.14.15 13.13.14.15.15 13.14.15.15.15 14.15.15.15.16 15.15.15.16.16 15.15.16.16.16 15.16.16.16.17 16.16.16.17.19 16.16.17.19.20 16.17.19.20.21 17.19.20.21.21 19.20.21.21.22 20.21.21.22.22 21.21.22.22.23 21.22.22.23.23 22.22.23.23.23 22.23.23.23.24 23.23.23.24.25 23.23.24.25.26 23.24.25.26.26 24.25.26.26.26 25.26.26.26.27 26.26.26.27.27 26.26.27.27.28 26.27.27.28.29 27.27.28.29.29 27.28.29.29.29 28.29.29.29.30 29.29.29.30.30 29.29.30.30.30 29.30.30.30.31 30.30.30.31.31 30.30.31.31.32 30.31.31.32.33 31.31.32.33.33 31.32.33.33.33 32.33.33.33.33 33.33.33.33.33 33.33.33.33.34 33.33.33.34.34 33.33.34.34.34 33.34.34.34.34 34.34.34.34.35 34.34.34.35.35 34.34.35.35.36 34.35.35.36.36 35.35.36.36.36 35.36.36.36.36 36.36.36.36.37 36.36.36.37.37 36.36.37.37.38 36.37.37.38.38 37.37.38.38.39 37.38.38.39.39 38.38.39.39.39 38.39.39.39.40 39.39.39.40.41 39.39.40.41.41 39.40.41.41.41 40.41.41.41.42 41.41.41.42.43 41.41.42.43.43 41.42.43.43.44 42.43.43.44.44 43.43.44.44.46 43.44.44.46.46 44.44.46.46.47 44.46.46.47.47 46.46.47.47.47 46.47.47.47.47 47.47.47.47.49 47.47.47.49.50 47.47.49.50.51 47.49.50.51.52 49.50.51.52.53 50.51.52.53.54 51.52.53.54.55 52.53.54.55.55 53.54.55.55.56 54.55.55.56.56 55.55.56.56.56 55.56.56.56.57 56.56.56.57.58 56.56.57.58.58 56.57.58.58.58 57.58.58.58.58 58.58.58.58.59 58.58.58.59.59 58.58.59.59.59 58.59.59.59.59 59.59.59.59.60 59.59.59.60.61 59.59.60.61.61 59.60.61.61.62 60.61.61.62.62 61.61.62.62.63 61.62.62.63.64 62.62.63.64.65 62.63.64.65.65 63.64.65.65.65 64.65.65.65.66 65.65.65.66.67 65.65.66.67.68 65.66.67.68.69 66.67.68.69.70 67.68.69.70.72 68.69.70.72.72 69.70.72.72.72 70.72.72.72.73 72.72.72.73.73 72.72.73.73.73 72.73.73.73.74 73.73.73.74.74 73.73.74.74.74 73.74.74.74.74 74.74.74.74.74 74.74.74.74.75 74.74.74.75.75 74.74.75.75.75 74.75.75.75.76 75.75.75.76.77 75.75.76.77.77 75.76.77.77.78 76.77.77.78.78 77.77.78.78.79 77.78.78.79.80 78.78.79.80.80 78.79.80.80.81 79.80.80.81.81 80.80.81.81.81 80.81.81.81.82 81.81.81.82.83 81.81.82.83.84 81.82.83.84.84 82.83.84.84.84 83.84.84.84.84 84.84.84.84.85 84.84.84.85.85 84.84.85.85.85 84.85.85.85.86 85.85.85.86.87 85.85.86.87.87 85.86.87.87.88 86.87.87.88.89 87.87.88.89.89 87.88.89.89.89 88.89.89.89.90 89.89.89.90.90 89.89.90.90.90 89.90.90.90.91 90.90.90.91.91 90.90.91.91.91 90.91.91.91.91 91.91.91.91.91 91.91.91.91.93 91.91.91.93.93 91.91.93.93.93 91.93.93.93.94 93.93.93.94.95 93.93.94.95.95 93.94.95.95.95 94.95.95.95.96 95.95.95.96.96 95.95.96.96.96 95.96.96.96.97 96.96.96.97.97 96.96.97.97.98 96.97.97.98.98 97.97.98.98.99 97.98.98.99.99 98.98.99.99.99}
do_execsql_test 1.8.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.10 0.10.20 0.10.20.30 0.10.20.30.30 10.20.30.30.30 20.30.30.30.40 30.30.30.40.50 30.30.40.50.60 30.40.50.60.70 40.50.60.70.80 50.60.70.80.80 60.70.80.80.90 70.80.80.90.90 80.80.90.90.90 1 1.1 1.1.11 1.1.11.11 1.1.11.11.21 1.11.11.21.21 11.11.21.21.31 11.21.21.31.31 21.21.31.31.41 21.31.31.41.41 31.31.41.41.41 31.41.41.41.51 41.41.41.51.61 41.41.51.61.61 41.51.61.61.81 51.61.61.81.81 61.61.81.81.81 61.81.81.81.91 81.81.81.91.91 81.81.91.91.91 81.91.91.91.91 91.91.91.91.91 2 2.2 2.2.2 2.2.2.12 2.2.2.12.12 2.2.12.12.12 2.12.12.12.22 12.12.12.22.22 12.12.22.22.32 12.22.22.32.42 22.22.32.42.52 22.32.42.52.62 32.42.52.62.62 42.52.62.62.72 52.62.62.72.72 62.62.72.72.72 62.72.72.72.82 3 3.3 3.3.13 3.3.13.13 3.3.13.13.23 3.13.13.23.23 13.13.23.23.23 13.23.23.23.33 23.23.23.33.33 23.23.33.33.33 23.33.33.33.33 33.33.33.33.33 33.33.33.33.43 33.33.33.43.43 33.33.43.43.53 33.43.43.53.63 43.43.53.63.73 43.53.63.73.73 53.63.73.73.73 63.73.73.73.83 73.73.73.83.93 73.73.83.93.93 73.83.93.93.93 4 4.14 4.14.24 4.14.24.34 4.14.24.34.34 14.24.34.34.34 24.34.34.34.34 34.34.34.34.44 34.34.34.44.44 34.34.44.44.54 34.44.44.54.64 44.44.54.64.74 44.54.64.74.74 54.64.74.74.74 64.74.74.74.74 74.74.74.74.74 74.74.74.74.84 74.74.74.84.84 74.74.84.84.84 74.84.84.84.84 84.84.84.84.94 5 5.5 5.5.15 5.5.15.15 5.5.15.15.15 5.15.15.15.25 15.15.15.25.35 15.15.25.35.35 15.25.35.35.55 25.35.35.55.55 35.35.55.55.65 35.55.55.65.65 55.55.65.65.65 55.65.65.65.75 65.65.65.75.75 65.65.75.75.75 65.75.75.75.85 75.75.75.85.85 75.75.85.85.85 75.85.85.85.95 85.85.85.95.95 85.85.95.95.95 6 6.16 6.16.16 6.16.16.16 6.16.16.16.26 16.16.16.26.26 16.16.26.26.26 16.26.26.26.36 26.26.26.36.36 26.26.36.36.36 26.36.36.36.36 36.36.36.36.46 36.36.36.46.46 36.36.46.46.56 36.46.46.56.56 46.46.56.56.56 46.56.56.56.66 56.56.56.66.76 56.56.66.76.86 56.66.76.86.96 66.76.86.96.96 76.86.96.96.96 7 7.7 7.7.7 7.7.7.17 7.7.7.17.27 7.7.17.27.27 7.17.27.27.37 17.27.27.37.37 27.27.37.37.47 27.37.37.47.47 37.37.47.47.47 37.47.47.47.47 47.47.47.47.57 47.47.47.57.67 47.47.57.67.77 47.57.67.77.77 57.67.77.77.87 67.77.77.87.87 77.77.87.87.97 77.87.87.97.97 8 8.8 8.8.8 8.8.8.28 8.8.8.28.38 8.8.28.38.38 8.28.38.38.58 28.38.38.58.58 38.38.58.58.58 38.58.58.58.58 58.58.58.58.68 58.58.58.68.78 58.58.68.78.78 58.68.78.78.88 68.78.78.88.98 78.78.88.98.98 9 9.9 9.9.9 9.9.9.19 9.9.9.19.29 9.9.19.29.29 9.19.29.29.29 19.29.29.29.39 29.29.29.39.39 29.29.39.39.39 29.39.39.39.49 39.39.39.49.59 39.39.49.59.59 39.49.59.59.59 49.59.59.59.59 59.59.59.59.69 59.59.59.69.79 59.59.69.79.89 59.69.79.89.89 69.79.89.89.89 79.89.89.89.99 89.89.89.99.99 89.89.99.99.99}
do_execsql_test 1.8.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW ) FROM t2
} {0 0.90 0.90.40 0.90.40.30 0.90.40.30.80 90.40.30.80.20 40.30.80.20.90 30.80.20.90.60 80.20.90.60.70 20.90.60.70.80 90.60.70.80.90 60.70.80.90.30 70.80.90.30.50 80.90.30.50.10 90.30.50.10.30 30.50.10.30.41 50.10.30.41.81 10.30.41.81.91 30.41.81.91.61 41.81.91.61.91 81.91.61.91.91 91.61.91.91.1 61.91.91.1.81 91.91.1.81.41 91.1.81.41.61 1.81.41.61.1 81.41.61.1.21 41.61.1.21.11 61.1.21.11.51 1.21.11.51.41 21.11.51.41.31 11.51.41.31.31 51.41.31.31.11 41.31.31.11.81 31.31.11.81.91 31.11.81.91.91 11.81.91.91.21 81.91.91.21.2 91.91.21.2.62 91.21.2.62.12 21.2.62.12.32 2.62.12.32.22 62.12.32.22.42 12.32.22.42.2 32.22.42.2.72 22.42.2.72.12 42.2.72.12.22 2.72.12.22.2 72.12.22.2.72 12.22.2.72.72 22.2.72.72.12 2.72.72.12.62 72.72.12.62.52 72.12.62.52.82 12.62.52.82.23 62.52.82.23.33 52.82.23.33.93 82.23.33.93.23 23.33.93.23.93 33.93.23.93.43 93.23.93.43.3 23.93.43.3.43 93.43.3.43.33 43.3.43.33.53 3.43.33.53.63 43.33.53.63.73 33.53.63.73.13 53.63.73.13.73 63.73.13.73.73 73.13.73.73.33 13.73.73.33.93 73.73.33.93.23 73.33.93.23.13 33.93.23.13.33 93.23.13.33.3 23.13.33.3.33 13.33.3.33.83 33.3.33.83.74 3.33.83.74.74 33.83.74.74.54 83.74.74.54.84 74.74.54.84.74 74.54.84.74.24 54.84.74.24.4 84.74.24.4.94 74.24.4.94.84 24.4.94.84.74 4.94.84.74.34 94.84.74.34.34 84.74.34.34.44 74.34.34.44.74 34.34.44.74.64 34.44.74.64.14 44.74.64.14.34 74.64.14.34.84 64.14.34.84.84 14.34.84.84.44 34.84.84.44.34 84.84.44.34.65 84.44.34.65.35 44.34.65.35.85 34.65.35.85.85 65.35.85.85.55 35.85.85.55.15 85.85.55.15.25 85.55.15.25.75 55.15.25.75.95 15.25.75.95.65 25.75.95.65.65 75.95.65.65.35 95.65.65.35.5 65.65.35.5.15 65.35.5.15.95 35.5.15.95.55 5.15.95.55.75 15.95.55.75.85 95.55.75.85.75 55.75.85.75.15 75.85.75.15.95 85.75.15.95.5 75.15.95.5.26 15.95.5.26.96 95.5.26.96.46 5.26.96.46.6 26.96.46.6.46 96.46.6.46.16 46.6.46.16.16 6.46.16.16.86 46.16.16.86.56 16.16.86.56.56 16.86.56.56.56 86.56.56.56.16 56.56.56.16.36 56.56.16.36.76 56.16.36.76.96 16.36.76.96.96 36.76.96.96.26 76.96.96.26.26 96.96.26.26.36 96.26.26.36.66 26.26.36.66.36 26.36.66.36.36 36.66.36.36.97 66.36.36.97.27 36.36.97.27.97 36.97.27.97.67 97.27.97.67.77 27.97.67.77.47 97.67.77.47.7 67.77.47.7.47 77.47.7.47.87 47.7.47.87.37 7.47.87.37.87 47.87.37.87.77 87.37.87.77.7 37.87.77.7.57 87.77.7.57.47 77.7.57.47.47 7.57.47.47.37 57.47.47.37.27 47.47.37.27.17 47.37.27.17.7 37.27.17.7.38 27.17.7.38.68 17.7.38.68.78 7.38.68.78.8 38.68.78.8.28 68.78.8.28.98 78.8.28.98.78 8.28.98.78.58 28.98.78.58.98 98.78.58.98.8 78.58.98.8.88 58.98.8.88.8 98.8.88.8.58 8.88.8.58.58 88.8.58.58.58 8.58.58.58.38 58.58.58.38.99 58.58.38.99.89 58.38.99.89.59 38.99.89.59.39 99.89.59.39.99 89.59.39.99.29 59.39.99.29.59 39.99.29.59.89 99.29.59.89.89 29.59.89.89.29 59.89.89.29.9 89.89.29.9.79 89.29.9.79.49 29.9.79.49.59 9.79.49.59.29 79.49.59.29.59 49.59.29.59.19 59.29.59.19.39 29.59.19.39.9 59.19.39.9.9 19.39.9.9.99 39.9.9.99.69 9.9.99.69.39}
do_execsql_test 1.8.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.8.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW)
} {1 {} 2 74 3 74 4 74.74 5 74.74 5 74.74.99 5 74.99 5 74.99.33 5 99.33 5 99.33.89 5 33.89 5 33.89.96 5 89.96 5 89.96.38 5 96.38 5 96.38.39 5 38.39 5 38.39.91 5 39.91 5 39.91.6 5 91.6 5 91.6.97 5 6.97 5 6.97.46 5 97.46 5 97.46.54 5 46.54 5 46.54.8 5 54.8 5 54.8.29 5 8.29 5 8.29.84 5 29.84 5 29.84.23 5 84.23 5 84.23.16 5 23.16 5 23.16.65 5 16.65 5 16.65.47 5 65.47 5 65.47.86 5 47.86 5 47.86.61 5 86.61 5 86.61.85 5 61.85 5 61.85.85 5 85.85 5 85.85.59 5 85.59 5 85.59.32 5 59.32 5 59.32.3 5 32.3 5 32.3.22 5 3.22 5 3.22.55 5 22.55 5 22.55.28 5 55.28 5 55.28.25 5 28.25 5 28.25.1 5 25.1 5 25.1.40 5 1.40 5 1.40.56 5 40.56 5 40.56.75 5 56.75 5 56.75.89 5 75.89 5 75.89.76 5 89.76 5 89.76.4 5 76.4 5 76.4.42 5 4.42 5 4.42.78 5 42.78 5 42.78.29 5 78.29 5 78.29.63 5 29.63 5 29.63.87 5 63.87 5 63.87.80 5 87.80 5 87.80.72 5 80.72 5 80.72.9 5 72.9 5 72.9.73 5 9.73 5 9.73.65 5 73.65 5 73.65.58 5 65.58 5 65.58.98 5 58.98 5 58.98.21 5 98.21 5 98.21.65 5 21.65 5 21.65.5 5 65.5 5 65.5.11 5 5.11 5 5.11.87 5 11.87 5 11.87.12 5 87.12 5 87.12.20 5 12.20 5 12.20.31 5 20.31 5 20.31.95 5 31.95 5 31.95.73 5 95.73 5 95.73.88 5 73.88 5 73.88.8 5 88.8 5 88.8.49 5 8.49 5 8.49.90 5 49.90 5 49.90.96 5 90.96 5 90.96.55 5 96.55 5 96.55.77 5 55.77 5 55.77.2 5 77.2 5 77.2.85 5 2.85 5 2.85.74 5 85.74 5 85.74.70 5 74.70 5 74.70.19 5 70.19 5 70.19.26 5 19.26 5 19.26.47 5 26.47 5 26.47.90 5 47.90 5 47.90.58 5 90.58 5 90.58.9 5 58.9 5 58.9.72 5 9.72 5 9.72.33 5 72.33 5 72.33.75 5 33.75 5 33.75.81 5 75.81 5 75.81.23 5 81.23 5 81.23.13 5 23.13 5 23.13.14 5 13.14 5 13.14.91 5 14.91 5 14.91.91 5 91.91 5 91.91.15 5 91.15 5 91.15.36 5 15.36 5 15.36.3 5 36.3 5 36.3.69 5 3.69 5 3.69.52 5 69.52 5 69.52.50 5 52.50 5 52.50.10 5 50.10 5 50.10.33 5 10.33 5 10.33.39 5 33.39 5 33.39.58 5 39.58 5 39.58.38 5 58.38 5 58.38.83 5 38.83 5 38.83.82 5 83.82 5 83.82.7 5 82.7}
do_execsql_test 1.8.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW)
} {1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {}}
do_execsql_test 1.8.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW)
} {1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {}}
do_execsql_test 1.8.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 PRECEDING AND CURRENT ROW)
} {1 89 2 89.6 3 89.6.29 4 89.6.29.47 5 89.6.29.47.59 5 6.29.47.59.28 5 29.47.59.28.75 5 47.59.28.75.78 5 59.28.75.78.72 5 28.75.78.72.98 5 75.78.72.98.87 5 78.72.98.87.73 5 72.98.87.73.96 5 98.87.73.96.74 5 87.73.96.74.90 5 73.96.74.90.75 5 96.74.90.75.91 5 74.90.75.91.69 5 90.75.91.69.39 5 75.91.69.39.7 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 74 2 74.96 3 74.96.97 4 74.96.97.84 5 74.96.97.84.86 5 96.97.84.86.32 5 97.84.86.32.25 5 84.86.32.25.89 5 86.32.25.89.29 5 32.25.89.29.9 5 25.89.29.9.21 5 89.29.9.21.12 5 29.9.21.12.88 5 9.21.12.88.55 5 21.12.88.55.70 5 12.88.55.70.58 5 88.55.70.58.81 5 55.70.58.81.91 5 70.58.81.91.52 5 58.81.91.52.58 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 74 2 74.38 3 74.38.46 4 74.38.46.23 5 74.38.46.23.61 5 38.46.23.61.3 5 46.23.61.3.1 5 23.61.3.1.76 5 61.3.1.76.63 5 3.1.76.63.73 5 1.76.63.73.65 5 76.63.73.65.20 5 63.73.65.20.8 5 73.65.20.8.77 5 65.20.8.77.19 5 20.8.77.19.9 5 8.77.19.9.23 5 77.19.9.23.15 5 19.9.23.15.50 5 9.23.15.50.38 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 99 2 99.39 3 99.39.54 4 99.39.54.16 5 99.39.54.16.85 5 39.54.16.85.22 5 54.16.85.22.40 5 16.85.22.40.4 5 85.22.40.4.87 5 22.40.4.87.65 5 40.4.87.65.5 5 4.87.65.5.31 5 87.65.5.31.49 5 65.5.31.49.2 5 5.31.49.2.26 5 31.49.2.26.72 5 49.2.26.72.13 5 2.26.72.13.36 5 26.72.13.36.10 5 72.13.36.10.83 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 1 33 2 33.91 3 33.91.8 4 33.91.8.65 5 33.91.8.65.85 5 91.8.65.85.55 5 8.65.85.55.56 5 65.85.55.56.42 5 85.55.56.42.80 5 55.56.42.80.58 5 56.42.80.58.11 5 42.80.58.11.95 5 80.58.11.95.90 5 58.11.95.90.85 5 11.95.90.85.47 5 95.90.85.47.33 5 90.85.47.33.14 5 85.47.33.14.3 5 47.33.14.3.33 5 33.14.3.33.82 1 {} 2 {} 3 {} 4 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {}}
do_execsql_test 1.9.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.9.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.9.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.9.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.9.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.9.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.9.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.9.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.9.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.9.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.9.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.9.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.9.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.9.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.9.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.9.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.9.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.9.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.9.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.9.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.9.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 76 44 78 28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206}
do_execsql_test 1.9.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.9.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 65 102 11 87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276}
do_execsql_test 1.9.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 196 134 109 213 223 106 234 191 212 168 229 147 218 240 65 102 119 136 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 11 87 138 63 124 179 78 141 84 120 234 79 231 162 227 228 280 57 181 110 179 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 80 182 71 157 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 111 206 74 132 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 26 51 52 85 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 48 144 207 216 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 36 121 132 88 52 232 156 210 239 250 83 103 158 210 171 198 101 163 172 163 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276}
do_execsql_test 1.9.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {1 147 106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229}
do_execsql_test 1.9.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.9.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.9.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.9.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99}
do_execsql_test 1.9.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 10 20 30 30 30 40 50 60 70 80 80 90 90 90 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 2 2 2 12 12 12 22 22 32 42 52 62 62 72 72 72 82 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 8 8 8 28 38 38 58 58 58 58 68 78 78 88 98 98 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99}
do_execsql_test 1.9.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.9.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.9.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.9.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.9.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.9.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.9.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.9.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.9.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.9.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99}
do_execsql_test 1.9.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 10 20 30 30 30 40 50 60 70 80 80 90 90 90 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 2 2 2 12 12 12 22 22 32 42 52 62 62 72 72 72 82 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 8 8 8 28 38 38 58 58 58 58 68 78 78 88 98 98 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99}
do_execsql_test 1.9.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND CURRENT ROW ) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.9.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND CURRENT ROW) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.9.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
} {1 {} 1 74 1 {} 1 74 1 {} 1 99 1 {} 1 33 1 {} 1 89 1 {} 1 96 1 {} 1 38 1 {} 1 39 1 {} 1 91 1 {} 1 6 1 {} 1 97 1 {} 1 46 1 {} 1 54 1 {} 1 8 1 {} 1 29 1 {} 1 84 1 {} 1 23 1 {} 1 16 1 {} 1 65 1 {} 1 47 1 {} 1 86 1 {} 1 61 1 {} 1 85 1 {} 1 85 1 {} 1 59 1 {} 1 32 1 {} 1 3 1 {} 1 22 1 {} 1 55 1 {} 1 28 1 {} 1 25 1 {} 1 1 1 {} 1 40 1 {} 1 56 1 {} 1 75 1 {} 1 89 1 {} 1 76 1 {} 1 4 1 {} 1 42 1 {} 1 78 1 {} 1 29 1 {} 1 63 1 {} 1 87 1 {} 1 80 1 {} 1 72 1 {} 1 9 1 {} 1 73 1 {} 1 65 1 {} 1 58 1 {} 1 98 1 {} 1 21 1 {} 1 65 1 {} 1 5 1 {} 1 11 1 {} 1 87 1 {} 1 12 1 {} 1 20 1 {} 1 31 1 {} 1 95 1 {} 1 73 1 {} 1 88 1 {} 1 8 1 {} 1 49 1 {} 1 90 1 {} 1 96 1 {} 1 55 1 {} 1 77 1 {} 1 2 1 {} 1 85 1 {} 1 74 1 {} 1 70 1 {} 1 19 1 {} 1 26 1 {} 1 47 1 {} 1 90 1 {} 1 58 1 {} 1 9 1 {} 1 72 1 {} 1 33 1 {} 1 75 1 {} 1 81 1 {} 1 23 1 {} 1 13 1 {} 1 14 1 {} 1 91 1 {} 1 91 1 {} 1 15 1 {} 1 36 1 {} 1 3 1 {} 1 69 1 {} 1 52 1 {} 1 50 1 {} 1 10 1 {} 1 33 1 {} 1 39 1 {} 1 58 1 {} 1 38 1 {} 1 83 1 {} 1 82 1 {} 1 7 1 {}}
do_execsql_test 1.9.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
} {1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {}}
do_execsql_test 1.9.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
} {1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {}}
do_execsql_test 1.9.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN CURRENT ROW AND CURRENT ROW)
} {1 89 1 6 1 29 1 47 1 59 1 28 1 75 1 78 1 72 1 98 1 87 1 73 1 96 1 74 1 90 1 75 1 91 1 69 1 39 1 7 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 74 1 96 1 97 1 84 1 86 1 32 1 25 1 89 1 29 1 9 1 21 1 12 1 88 1 55 1 70 1 58 1 81 1 91 1 52 1 58 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 74 1 38 1 46 1 23 1 61 1 3 1 1 1 76 1 63 1 73 1 65 1 20 1 8 1 77 1 19 1 9 1 23 1 15 1 50 1 38 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 99 1 39 1 54 1 16 1 85 1 22 1 40 1 4 1 87 1 65 1 5 1 31 1 49 1 2 1 26 1 72 1 13 1 36 1 10 1 83 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 33 1 91 1 8 1 65 1 85 1 55 1 56 1 42 1 80 1 58 1 11 1 95 1 90 1 85 1 47 1 33 1 14 1 3 1 33 1 82 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {} 1 {}}
do_execsql_test 1.10.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {74 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.10.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.10.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.10.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.10.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.10.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.10.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.10.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.10.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.10.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.10.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.10.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.10.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.10.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.10.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.10.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.10.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.10.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.10.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.10.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.10.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206 206 206 206 206}
do_execsql_test 1.10.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {168 134 218 191 212 229 240 213 234 196 223 223 223 223 223 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 210 210 210 210 78 120 87 162 124 141 138 227 228 179 231 234 280 280 280 280 280 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 279 279 279 279 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 229 229 229 229 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 206 206 206 206 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 212 212 212 212 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 207 207 207 207 88 171 158 156 198 121 210 132 210 239 250 232 232 232 232 232 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229 229 229 229 229}
do_execsql_test 1.10.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276 276 276 276 276}
do_execsql_test 1.10.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {213 223 106 234 191 212 168 229 147 218 240 240 240 240 240 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 263 263 263 263 124 179 78 141 84 120 234 79 231 162 227 228 280 280 280 280 280 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 252 252 252 252 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 171 171 171 171 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 274 274 274 274 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 226 226 226 226 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 124 124 124 124 52 232 156 210 239 250 83 103 158 210 171 198 198 198 198 198 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276 276 276 276 276}
do_execsql_test 1.10.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229 229 229 229 229}
do_execsql_test 1.10.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.10.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 41 {} {} {} {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} 2 {} 29 {} {} {} 46 62 62 {} {} 16 {} 33 {} {} {} {} {} 78 {} 61 {} 59 77 90 74 {} 27 {} 22 39 67 {} 54 85 74 90 7 61 90 62 {} 93 {} {} 94 {} 23 {} 74 93 30 23 29 3 1 41 80 65 33 2 98 86 89 25 76 65 40 38 15 13 96 74 97 81 40 16 99 76 96 32 80 86 59 2 99 84 84 39 65 27 76 78 84 16 2 96 59 16 41 28 13 89 22 4 42 91 41 33 87 55 81 29 36 28 6 47 97 97 85 33 41 93 15 85 89 98 98 43 23 73 4 56 29 89 46 65 38 59 68 47 9 93 9 23 39 16 93 98 74 65 75 15 56 93 12 2 81 2 23 97 47 91 15 93 35 16 63 8 53 91 33 99}
do_execsql_test 1.10.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} 81 {} {} {} 81 {} 21 {} {} {} {} 21 {} {} {} 21 12 {} {} {} {} {} 12 {} 72 {} 12 {} {} 72 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} 73 {} {} {} {} {} 73 {} 23 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} 64 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 15 55 {} {} {} {} {} 55 {} 15 {} {} {} 16 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 47 {} {} {} {} {} 27 47 {} {} {} {} {} {} {} {} {} 98 {} 98 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 29 {} {} {} {} {} 9 {} 29 29 {} {} {}}
do_execsql_test 1.10.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 4 4 5 5 5 5 6 6 7 7 7 7 7 7 8 8 8 8 8 8 8 9 9 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 17 17 17 17 19 19 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 25 25 25 25 26 26 27 27 28 29 29 29 29 29 29 30 30 30 30 30 30 30 30 30 31 31 31 32 32 33 33 33 33 33 33 33 34 34 34 35 35 35 35 35 35 36 36 36 36 36 36 36 36 36 36 36 37 37 37 38 38 38 38 38 39 39 39 39 39 39 40 40 40 41 41 41 41 42 42 42 43 43 43 43 43 43 43 43 44 44 44 46 46 46 46 47 47 47 47 47 47 47 47 47 47}
do_execsql_test 1.10.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 2 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 13 13 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} 90 {} {} {} 90 1 30 {} {} 31 31 30 {} {} {} 1 40 {} 50 11 81 42 40 {} 50 81 40 {} {} 50 {} 52 {} 41 81 {} 41 {} 2 30 2 81 82 53 {} 10 {} {} 81 {} 41 10 81 30 81 {} 3 3 23 94 3 61 80 {} 94 3 91 91 72 3 63 30 91 94 94 72 91 73 91 84 84 33 41 1 33 84 73 73 91 20 41 84 33 33 84 33 41 84 20 21 44 22 90 22 81 81 74 93 93 93 81 21 83 44 44 21 21 21 13 21 21 34 11 34 73 74 2 60 2 34 2 34 74 60 23 2 2 2 11 91 60 62 73 74 70 51 65 74 93 65 70 34 70 93 93 93 62 35 44 43 12 35 41 43 44 44 41 80 54 72 43 41 43 91 12 80 80 35 33 12}
do_execsql_test 1.10.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.10.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.10.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.10.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9}
do_execsql_test 1.10.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.10.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.10.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.10.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.10.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.10.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.10.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.10.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0.74.41.74.23 0.74.41.74.23.99 0.74.41.74.23.99.26 0.74.41.74.23.99.26.33 0.74.41.74.23.99.26.33.2 0.74.41.74.23.99.26.33.2.89 0.74.41.74.23.99.26.33.2.89.81 0.74.41.74.23.99.26.33.2.89.81.96 0.74.41.74.23.99.26.33.2.89.81.96.59 0.74.41.74.23.99.26.33.2.89.81.96.59.38 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46
do_execsql_test 1.10.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 0.90.40.30.80.20.90.60 0.90.40.30.80.20.90.60.70 0.90.40.30.80.20.90.60.70.80 0.90.40.30.80.20.90.60.70.80.90 0.90.40.30.80.20.90.60.70.80.90.30 0.90.40.30.80.20.90.60.70.80.90.30.50 0.90.40.30.80.20.90.60.70.80.90.30.50.10 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 41.81.91.61.91 41.81.91.61.91.91 41.81.91.61.91.91.1 41.81.91.61.91.91.1.81 41.81.91.61.91.91.1.81.41 41.81.91.61.91.91.1.81.41.61 41.81.91.61.91.91.1.81.41.61.1 41.81.91.61.91.91.1.81.41.61.1.21 41.81.91.61.91.91.1.81.41.61.1.21.11 41.81.91.61.91.91.1.81.41.61.1.21.11.51 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 2.62.12.32.22 2.62.12.32.22.42 2.62.12.32.22.42.2 2.62.12.32.22.42.2.72 2.62.12.32.22.42.2.72.12 2.62.12.32.22.42.2.72.12.22 2.62.12.32.22.42.2.72.12.22.2 2.62.12.32.22.42.2.72.12.22.2.72 2.62.12.32.22.42.2.72.12.22.2.72.72 2.62.12.32.22.42.2.72.12.22.2.72.72.12 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 23.33.93.23.93 23.33.93.23.93.43 23.33.93.23.93.43.3 23.33.93.23.93.43.3.43 23.33.93.23.93.43.3.43.33 23.33.93.23.93.43.3.43.33.53 23.33.93.23.93.43.3.43.33.53.63 23.33.93.23.93.43.3.43.33.53.63.73 23.33.93.23.93.43.3.43.33.53.63.73.13 23.33.93.23.93.43.3.43.33.53.63.73.13.73 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 74.74.54.84.74 74.74.54.84.74.24 74.74.54.84.74.24.4 74.74.54.84.74.24.4.94 74.74.54.84.74.24.4.94.84 74.74.54.84.74.24.4.94.84.74 74.74.54.84.74.24.4.94.84.74.34 74.74.54.84.74.24.4.94.84.74.34.34 74.74.54.84.74.24.4.94.84.74.34.34.44 74.74.54.84.74.24.4.94.84.74.34.34.44.74 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74
do_execsql_test 1.10.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0.1.1.2.2 0.1.1.2.2.2 0.1.1.2.2.2.3 0.1.1.2.2.2.3.3 0.1.1.2.2.2.3.3.4 0.1.1.2.2.2.3.3.4.5 0.1.1.2.2.2.3.3.4.5.5 0.1.1.2.2.2.3.3.4.5.5.6 0.1.1.2.2.2.3.3.4.5.5.6.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.
do_execsql_test 1.10.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0.10.20.30.30 0.10.20.30.30.30 0.10.20.30.30.30.40 0.10.20.30.30.30.40.50 0.10.20.30.30.30.40.50.60 0.10.20.30.30.30.40.50.60.70 0.10.20.30.30.30.40.50.60.70.80 0.10.20.30.30.30.40.50.60.70.80.80 0.10.20.30.30.30.40.50.60.70.80.80.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 1.1.11.11.21 1.1.11.11.21.21 1.1.11.11.21.21.31 1.1.11.11.21.21.31.31 1.1.11.11.21.21.31.31.41 1.1.11.11.21.21.31.31.41.41 1.1.11.11.21.21.31.31.41.41.41 1.1.11.11.21.21.31.31.41.41.41.51 1.1.11.11.21.21.31.31.41.41.41.51.61 1.1.11.11.21.21.31.31.41.41.41.51.61.61 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 2.2.2.12.12 2.2.2.12.12.12 2.2.2.12.12.12.22 2.2.2.12.12.12.22.22 2.2.2.12.12.12.22.22.32 2.2.2.12.12.12.22.22.32.42 2.2.2.12.12.12.22.22.32.42.52 2.2.2.12.12.12.22.22.32.42.52.62 2.2.2.12.12.12.22.22.32.42.52.62.62 2.2.2.12.12.12.22.22.32.42.52.62.62.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 3.3.13.13.23 3.3.13.13.23.23 3.3.13.13.23.23.23 3.3.13.13.23.23.23.33 3.3.13.13.23.23.23.33.33 3.3.13.13.23.23.23.33.33.33 3.3.13.13.23.23.23.33.33.33.33 3.3.13.13.23.23.23.33.33.33.33.33 3.3.13.13.23.23.23.33.33.33.33.33.43 3.3.13.13.23.23.23.33.33.33.33.33.43.43 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 4.14.24.34.34 4.14.24.34.34.34 4.14.24.34.34.34.34 4.14.24.34.34.34.34.44 4.14.24.34.34.34.34.44.44 4.14.24.34.34.34.34.44.44.54 4.14.24.34.34.34.34.44.44.54.64 4.14.24.34.34.34.34.44.44.54.64.74 4.14.24.34.34.34.34.44.44.54.64.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 4.14.24.34.3
do_execsql_test 1.10.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING ) FROM t2
} {0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 0.90.40.30.80.20.90.60 0.90.40.30.80.20.90.60.70 0.90.40.30.80.20.90.60.70.80 0.90.40.30.80.20.90.60.70.80.90 0.90.40.30.80.20.90.60.70.80.90.30 0.90.40.30.80.20.90.60.70.80.90.30.50 0.90.40.30.80.20.90.60.70.80.90.30.50.10 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62 0.90.40.30.80.20.90.60.70.8
do_execsql_test 1.10.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.10.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING)
} {5 74.74 6 74.74.99 7 74.74.99 8 74.74.99.33 9 74.74.99.33 10 74.74.99.33.89 11 74.74.99.33.89 12 74.74.99.33.89.96 13 74.74.99.33.89.96 14 74.74.99.33.89.96.38 15 74.74.99.33.89.96.38 16 74.74.99.33.89.96.38.39 17 74.74.99.33.89.96.38.39 18 74.74.99.33.89.96.38.39.91 19 74.74.99.33.89.96.38.39.91 20 74.74.99.33.89.96.38.39.91.6 21 74.74.99.33.89.96.38.39.91.6 22 74.74.99.33.89.96.38.39.91.6.97 23 74.74.99.33.89.96.38.39.91.6.97 24 74.74.99.33.89.96.38.39.91.6.97.46 25 74.74.99.33.89.96.38.39.91.6.97.46 26 74.74.99.33.89.96.38.39.91.6.97.46.54 27 74.74.99.33.89.96.38.39.91.6.97.46.54 28 74.74.99.33.89.96.38.39.91.6.97.46.54.8 29 74.74.99.33.89.96.38.39.91.6.97.46.54.8 30 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29 31 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29 32 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84 33 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84 34 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23 35 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23 36 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16 37 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16 38 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65 39 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65 40 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47 41 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47 42 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86 43 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86 44 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61 45 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61 46 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85 47 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85 48 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85 49 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85 50 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59 51 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59 52 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32 53 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32 54 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3 55 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3 56 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22 57 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22 58 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55 59 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55 60 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28 61 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28 62 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25 63 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25 64 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1 65 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1 66 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40 67 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40 68 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56 69 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56 70 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75 71 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75 72 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89 73 74.7
do_execsql_test 1.10.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING)
} {5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 22 {} 23 {} 24 {} 25 {} 26 {} 27 {} 28 {} 29 {} 30 {} 31 {} 32 {} 33 {} 34 {} 35 {} 36 {} 37 {} 38 {} 39 {} 40 {} 41 {} 42 {} 43 {} 44 {} 45 {} 46 {} 47 {} 48 {} 49 {} 50 {} 51 {} 52 {} 53 {} 54 {} 55 {} 56 {} 57 {} 58 {} 59 {} 60 {} 61 {} 62 {} 63 {} 64 {} 65 {} 66 {} 67 {} 68 {} 69 {} 70 {} 71 {} 72 {} 73 {} 74 {} 75 {} 76 {} 77 {} 78 {} 79 {} 80 {} 81 {} 82 {} 83 {} 84 {} 85 {} 86 {} 87 {} 88 {} 89 {} 90 {} 91 {} 92 {} 93 {} 94 {} 95 {} 96 {} 97 {} 98 {} 99 {} 100 {} 101 {} 102 {} 103 {} 104 {} 105 {} 106 {} 107 {} 108 {} 109 {} 110 {} 111 {} 112 {} 113 {} 114 {} 115 {} 116 {} 117 {} 118 {} 119 {} 120 {} 121 {} 122 {} 123 {} 124 {} 125 {} 126 {} 127 {} 128 {} 129 {} 130 {} 131 {} 132 {} 133 {} 134 {} 135 {} 136 {} 137 {} 138 {} 139 {} 140 {} 141 {} 142 {} 143 {} 144 {} 145 {} 146 {} 147 {} 148 {} 149 {} 150 {} 151 {} 152 {} 153 {} 154 {} 155 {} 156 {} 157 {} 158 {} 159 {} 160 {} 161 {} 162 {} 163 {} 164 {} 165 {} 166 {} 167 {} 168 {} 169 {} 170 {} 171 {} 172 {} 173 {} 174 {} 175 {} 176 {} 177 {} 178 {} 179 {} 180 {} 181 {} 182 {} 183 {} 184 {} 185 {} 186 {} 187 {} 188 {} 189 {} 190 {} 191 {} 192 {} 193 {} 194 {} 195 {} 196 {} 197 {} 198 {} 199 {} 200 {} 201 {} 201 {} 201 {} 201 {} 201 {}}
do_execsql_test 1.10.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING)
} {5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 21 {} 21 {} 21 {} 21 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {}}
do_execsql_test 1.10.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND 4 FOLLOWING)
} {5 89.6.29.47.59 6 89.6.29.47.59.28 7 89.6.29.47.59.28.75 8 89.6.29.47.59.28.75.78 9 89.6.29.47.59.28.75.78.72 10 89.6.29.47.59.28.75.78.72.98 11 89.6.29.47.59.28.75.78.72.98.87 12 89.6.29.47.59.28.75.78.72.98.87.73 13 89.6.29.47.59.28.75.78.72.98.87.73.96 14 89.6.29.47.59.28.75.78.72.98.87.73.96.74 15 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90 16 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75 17 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91 18 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69 19 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 21 {} 21 {} 21 {} 21 {} 21 {} 5 74.96.97.84.86 6 74.96.97.84.86.32 7 74.96.97.84.86.32.25 8 74.96.97.84.86.32.25.89 9 74.96.97.84.86.32.25.89.29 10 74.96.97.84.86.32.25.89.29.9 11 74.96.97.84.86.32.25.89.29.9.21 12 74.96.97.84.86.32.25.89.29.9.21.12 13 74.96.97.84.86.32.25.89.29.9.21.12.88 14 74.96.97.84.86.32.25.89.29.9.21.12.88.55 15 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70 16 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58 17 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81 18 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91 19 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 74.38.46.23.61 6 74.38.46.23.61.3 7 74.38.46.23.61.3.1 8 74.38.46.23.61.3.1.76 9 74.38.46.23.61.3.1.76.63 10 74.38.46.23.61.3.1.76.63.73 11 74.38.46.23.61.3.1.76.63.73.65 12 74.38.46.23.61.3.1.76.63.73.65.20 13 74.38.46.23.61.3.1.76.63.73.65.20.8 14 74.38.46.23.61.3.1.76.63.73.65.20.8.77 15 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19 16 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9 17 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23 18 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15 19 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 5 {} 6 {} 7 {} 8 {} 9 {} 10 {} 11 {} 12 {} 13 {} 14 {} 15 {} 16 {} 17 {} 18 {} 19 {} 20 {} 20 {} 20 {} 20 {} 20 {} 5 99.39.54.16.85 6 99.39.54.16.85.22 7 99.39.54.16.85.22.40 8 99.39.54.16.85.22.40.4 9 99.39.54.16.85.22.40.4.87 10 99.39.54.16.85.22.40.4.87.65 11 99.39.54.16.85.22.40.4.87.65.5 12 99.39.54.16.85.22.40.4.87.65.5.31 13 99.39.54.16.85.22.40.4.87.65.5.31.49 14 99.39.54.16.85.22.40.4.87.65.5.31.49.2 15 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26 16 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72 17 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13 18 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36 19 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 5 {} 6 {} 7 {}
do_execsql_test 1.11.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {74 74 74 99 99 99 99 99 99 99 96 96 96 96 96 96 91 91 99 99 99 99 99 99 99 97 97 97 97 97 97 93 93 93 93 93 93 93 93 93 93 86 91 91 91 91 91 91 91 85 85 85 91 91 91 91 91 91 91 90 90 89 89 89 89 56 56 75 75 89 98 98 98 98 98 98 98 94 94 94 94 78 78 87 87 87 87 87 87 87 84 84 95 95 95 95 96 98 98 98 98 98 98 98 74 74 74 87 87 87 87 87 87 87 41 95 95 95 95 95 95 95 88 88 88 90 90 96 96 96 96 96 96 96 77 85 85 85 85 85 85 85 74 74 70 70 80 90 90 90 90 90 90 90 72 72 93 93 93 93 93 93 93 81 81 81 62 91 91 91 91 91 91 91 99 99 99 99 99 99 99 95 95 84 84 84 84 84 84 84 84 58 58 83 83 83 83 83 83 83 82}
do_execsql_test 1.11.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 0 0 0 0 23 2 2 2 2 2 2 2 38 38 38 38 6 6 6 6 6 6 6 27 8 8 8 8 8 8 8 16 16 16 16 16 16 7 7 7 7 7 7 7 24 24 24 12 12 12 3 3 3 3 3 3 3 15 15 15 1 1 1 1 1 1 1 16 16 16 16 16 4 4 4 4 4 4 4 29 29 2 2 2 2 2 2 2 9 9 9 9 9 9 9 13 13 1 1 1 1 1 1 1 5 5 5 5 5 8 8 8 8 8 8 8 15 15 15 15 8 8 8 8 8 8 8 11 34 34 55 44 2 2 2 2 2 2 2 7 19 19 19 19 19 19 19 26 26 26 9 9 9 9 9 9 9 33 33 9 9 9 9 9 9 9 12 12 12 12 14 15 15 15 3 3 3 3 3 3 3 30 10 10 10 10 10 10 10 21 21 21 30 27 27 17 7 5 5 5}
do_execsql_test 1.11.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.11.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.11.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.11.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.11.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.11.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.11.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.11.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.11.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.11.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.11.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.11.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.11.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.11.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.11.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.11.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.11.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.11.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.11.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {44 78 28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206 206 206}
do_execsql_test 1.11.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {106 109 168 134 218 191 212 229 240 213 234 196 223 223 223 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 210 210 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 280 280 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 279 279 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 229 229 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 206 206 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 212 212 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 207 207 103 36 88 171 158 156 198 121 210 132 210 239 250 232 232 232 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229 229 229}
do_execsql_test 1.11.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {102 11 87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276 276 276}
do_execsql_test 1.11.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {134 109 213 223 106 234 191 212 168 229 147 218 240 240 240 119 136 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 263 263 138 63 124 179 78 141 84 120 234 79 231 162 227 228 280 280 280 110 179 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 252 252 71 157 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 171 171 74 132 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 274 274 52 85 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 226 226 207 216 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 124 124 132 88 52 232 156 210 239 250 83 103 158 210 171 198 198 198 172 163 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276 276 276}
do_execsql_test 1.11.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {106 109 168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229 229 229}
do_execsql_test 1.11.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.11.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 97 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 56 {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} {} {} {} {} 4 {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 {} {} {} {} 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 77 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 81 {} {} {} {} {} {} {} {} {} {} {} 12 {} {} {} {} {} 22 {} {} {} 12 {} {} {} {} {} {} {} {} {} {} {} {} 43 {} {} {} {} {} {} {} {} {} {} {} {} {} 33 {} {} {} {} {} {} {} {} 4 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 15 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 1 1 1 1 2 2 3 4 5 6 7 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 2 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 13 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 81 {} {} {} {} {} {} {} {} {} {} {} 91 {} {} {} {} {} 22 {} {} {} 12 {} {} {} {} {} {} {} {} {} {} {} {} 43 {} {} {} {} {} {} {} {} {} {} {} {} {} 33 {} {} {} {} {} {} {} {} 4 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 15 {} {} {} {} {} {} {} {} 26 {} {} {} 16 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 0 0 0 0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27}
do_execsql_test 1.11.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 0 0 0 0 90 40 30 80 20 90 60 70 80 90 41 41 41 41 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 2 2 2 2 2 62 12 32 22 42 2 72 12 22 2 72 72 23 23 23 23 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 74 74 74 74 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 65 65 65 65 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 26 26 26 26 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 97 97 97 97 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 38 38 38 38 38 68 78 8 28 98 78 58 98 8 88 8 99 99 99 99 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9}
do_execsql_test 1.11.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 0 0 0 0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98}
do_execsql_test 1.11.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 0 0 0 0 10 20 30 30 30 40 50 60 70 80 1 1 1 1 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 2 2 2 2 2 2 2 12 12 12 22 22 32 42 52 62 62 3 3 3 3 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 4 4 4 4 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 5 5 5 5 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 6 6 6 6 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 7 7 7 7 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 8 8 8 8 8 8 8 28 38 38 58 58 58 58 68 78 9 9 9 9 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89}
do_execsql_test 1.11.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 0 0 0 0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9}
do_execsql_test 1.11.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.11.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.11.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.11.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.11.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.11.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.11.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0.74.41 0.74.41.74 0.74.41.74.23 0.74.41.74.23.99 0.74.41.74.23.99.26 74.41.74.23.99.26.33 41.74.23.99.26.33.2 74.23.99.26.33.2.89 23.99.26.33.2.89.81 99.26.33.2.89.81.96 26.33.2.89.81.96.59 33.2.89.81.96.59.38 2.89.81.96.59.38.68 89.81.96.59.38.68.39 81.96.59.38.68.39.62 96.59.38.68.39.62.91 59.38.68.39.62.91.46 38.68.39.62.91.46.6 68.39.62.91.46.6.99 39.62.91.46.6.99.97 62.91.46.6.99.97.27 91.46.6.99.97.27.46 46.6.99.97.27.46.78 6.99.97.27.46.78.54 99.97.27.46.78.54.97 97.27.46.78.54.97.8 27.46.78.54.97.8.67 46.78.54.97.8.67.29 78.54.97.8.67.29.93 54.97.8.67.29.93.84 97.8.67.29.93.84.77 8.67.29.93.84.77.23 67.29.93.84.77.23.16 29.93.84.77.23.16.16 93.84.77.23.16.16.93 84.77.23.16.16.93.65 77.23.16.16.93.65.35 23.16.16.93.65.35.47 16.16.93.65.35.47.7 16.93.65.35.47.7.86 93.65.35.47.7.86.74 65.35.47.7.86.74.61 35.47.7.86.74.61.91 47.7.86.74.61.91.85 7.86.74.61.91.85.24 86.74.61.91.85.24.85 74.61.91.85.24.85.43 61.91.85.24.85.43.59 91.85.24.85.43.59.12 85.24.85.43.59.12.32 24.85.43.59.12.32.56 85.43.59.12.32.56.3 43.59.12.32.56.3.91 59.12.32.56.3.91.22 12.32.56.3.91.22.90 32.56.3.91.22.90.55 56.3.91.22.90.55.15 3.91.22.90.55.15.28 91.22.90.55.15.28.89 22.90.55.15.28.89.25 90.55.15.28.89.25.47 55.15.28.89.25.47.1 15.28.89.25.47.1.56 28.89.25.47.1.56.40 89.25.47.1.56.40.43 25.47.1.56.40.43.56 47.1.56.40.43.56.16 1.56.40.43.56.16.75 56.40.43.56.16.75.36 40.43.56.16.75.36.89 43.56.16.75.36.89.98 56.16.75.36.89.98.76 16.75.36.89.98.76.81 75.36.89.98.76.81.4 36.89.98.76.81.4.94 89.98.76.81.4.94.42 98.76.81.4.94.42.30 76.81.4.94.42.30.78 81.4.94.42.30.78.33 4.94.42.30.78.33.29 94.42.30.78.33.29.53 42.30.78.33.29.53.63 30.78.33.29.53.63.2 78.33.29.53.63.2.87 33.29.53.63.2.87.37 29.53.63.2.87.37.80 53.63.2.87.37.80.84 63.2.87.37.80.84.72 2.87.37.80.84.72.41 87.37.80.84.72.41.9 37.80.84.72.41.9.61 80.84.72.41.9.61.73 84.72.41.9.61.73.95 72.41.9.61.73.95.65 41.9.61.73.95.65.13 9.61.73.95.65.13.58 61.73.95.65.13.58.96 73.95.65.13.58.96.98 95.65.13.58.96.98.1 65.13.58.96.98.1.21 13.58.96.98.1.21.74 58.96.98.1.21.74.65 96.98.1.21.74.65.35 98.1.21.74.65.35.5 1.21.74.65.35.5.73 21.74.65.35.5.73.11 74.65.35.5.73.11.51 65.35.5.73.11.51.87 35.5.73.11.51.87.41 5.73.11.51.87.41.12 73.11.51.87.41.12.8 11.51.87.41.12.8.20 51.87.41.12.8.20.31 87.41.12.8.20.31.31 41.12.8.20.31.31.15 12.8.20.31.31.15.95 8.20.31.31.15.95.22 20.31.31.15.95.22.73 31.31.15.95.22.73.79 31.15.95.22.73.79.88 15.95.22.73.79.88.34 95.22.73.79.88.34.8 22.73.79.88.34.8.11 73.79.88.34.8.11.49 79.88.34.8.11.49.34 88.34.8.11.49.34.90 34.8.11.49.34.90.59 8.11.49.34.90.59.96 11.49.34.90.59.96.60 49.34.90.59.96.60.55 34.90.59.96.60.55.75 90.59.96.60.55.75.77 59.96.60.55.75.77.44 96.60.55.75.77.44.2 60.55.75.77.44.2.7 55.75.77.44.2.7.85 75.77.44.2.7.85.57 77.44.2.7.85.57.74 44.2.7.85.57.74.29 2.7.85.57.74.29.70 7.85.57.74.29.70.59 85.57.74.29.70.59.19 57.74.29.70.59.19.39 74.29.70.59.19.39.26 29.70.59.19.39.26.26 70.59.19.39.26.26.47 59.19.39.26.26.47.80 19.39.26.26.47.80.90 39.26.26.47.80.90.36 26.26.47.80.90.36.58 26.47.80.90.36.58.47 47.80.90.36.58.47.9 80.90.36.58.47.9.72 90.36.58.47.9.72.72 36.58.47.9.72.72.66 58.47.9.72.72.66.33 47.9.72.72.66.33.93 9.72.72.66.33.93.75 72.72.66.33.93.75.64 72.66.33.93.75.64.81 66.33.93.75.64.81.9 33.93.75.64.81.9.23 93.75.64.81.9.23.37 75.64.81.9.23.37.13 64.81.9.23.37.13.12 81.9.23.37.13.12.14 9.23.37.13.12.14.62 23.37.13.12.14.62.91 37.13.12.14.62.91.36 13.12.14.62.91.36.91 12.14.62.91.36.91.33 14.62.91.36.91.33.15 62.91.36.91.33.15.34 91.36.91.33.15.34.36 36.91.33.15.34.36.99 91.33.15.34.36.99.3 33.15.34.36.99.3.95 15.34.36.99.3.95.69 34.36.99.3.95.69.58 36.99.3.95.69.58.52 99.3.95.69.58.52.30 3.95.69.58.52.30.50 95.69.58.52.30.50.84 69.58.52.30.50.84.10 58.52.30.50.84.10.84
do_execsql_test 1.11.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0.90.40 0.90.40.30 0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 90.40.30.80.20.90.60 40.30.80.20.90.60.70 30.80.20.90.60.70.80 80.20.90.60.70.80.90 20.90.60.70.80.90.30 90.60.70.80.90.30.50 60.70.80.90.30.50.10 70.80.90.30.50.10.30 80.90.30.50.10.30 90.30.50.10.30 41.81.91 41.81.91.61 41.81.91.61.91 41.81.91.61.91.91 41.81.91.61.91.91.1 81.91.61.91.91.1.81 91.61.91.91.1.81.41 61.91.91.1.81.41.61 91.91.1.81.41.61.1 91.1.81.41.61.1.21 1.81.41.61.1.21.11 81.41.61.1.21.11.51 41.61.1.21.11.51.41 61.1.21.11.51.41.31 1.21.11.51.41.31.31 21.11.51.41.31.31.11 11.51.41.31.31.11.81 51.41.31.31.11.81.91 41.31.31.11.81.91.91 31.31.11.81.91.91.21 31.11.81.91.91.21 11.81.91.91.21 2.62.12 2.62.12.32 2.62.12.32.22 2.62.12.32.22.42 2.62.12.32.22.42.2 62.12.32.22.42.2.72 12.32.22.42.2.72.12 32.22.42.2.72.12.22 22.42.2.72.12.22.2 42.2.72.12.22.2.72 2.72.12.22.2.72.72 72.12.22.2.72.72.12 12.22.2.72.72.12.62 22.2.72.72.12.62.52 2.72.72.12.62.52.82 72.72.12.62.52.82 72.12.62.52.82 23.33.93 23.33.93.23 23.33.93.23.93 23.33.93.23.93.43 23.33.93.23.93.43.3 33.93.23.93.43.3.43 93.23.93.43.3.43.33 23.93.43.3.43.33.53 93.43.3.43.33.53.63 43.3.43.33.53.63.73 3.43.33.53.63.73.13 43.33.53.63.73.13.73 33.53.63.73.13.73.73 53.63.73.13.73.73.33 63.73.13.73.73.33.93 73.13.73.73.33.93.23 13.73.73.33.93.23.13 73.73.33.93.23.13.33 73.33.93.23.13.33.3 33.93.23.13.33.3.33 93.23.13.33.3.33.83 23.13.33.3.33.83 13.33.3.33.83 74.74.54 74.74.54.84 74.74.54.84.74 74.74.54.84.74.24 74.74.54.84.74.24.4 74.54.84.74.24.4.94 54.84.74.24.4.94.84 84.74.24.4.94.84.74 74.24.4.94.84.74.34 24.4.94.84.74.34.34 4.94.84.74.34.34.44 94.84.74.34.34.44.74 84.74.34.34.44.74.64 74.34.34.44.74.64.14 34.34.44.74.64.14.34 34.44.74.64.14.34.84 44.74.64.14.34.84.84 74.64.14.34.84.84.44 64.14.34.84.84.44.34 14.34.84.84.44.34 34.84.84.44.34 65.35.85 65.35.85.85 65.35.85.85.55 65.35.85.85.55.15 65.35.85.85.55.15.25 35.85.85.55.15.25.75 85.85.55.15.25.75.95 85.55.15.25.75.95.65 55.15.25.75.95.65.65 15.25.75.95.65.65.35 25.75.95.65.65.35.5 75.95.65.65.35.5.15 95.65.65.35.5.15.95 65.65.35.5.15.95.55 65.35.5.15.95.55.75 35.5.15.95.55.75.85 5.15.95.55.75.85.75 15.95.55.75.85.75.15 95.55.75.85.75.15.95 55.75.85.75.15.95.5 75.85.75.15.95.5 85.75.15.95.5 26.96.46 26.96.46.6 26.96.46.6.46 26.96.46.6.46.16 26.96.46.6.46.16.16 96.46.6.46.16.16.86 46.6.46.16.16.86.56 6.46.16.16.86.56.56 46.16.16.86.56.56.56 16.16.86.56.56.56.16 16.86.56.56.56.16.36 86.56.56.56.16.36.76 56.56.56.16.36.76.96 56.56.16.36.76.96.96 56.16.36.76.96.96.26 16.36.76.96.96.26.26 36.76.96.96.26.26.36 76.96.96.26.26.36.66 96.96.26.26.36.66.36 96.26.26.36.66.36.36 26.26.36.66.36.36 26.36.66.36.36 97.27.97 97.27.97.67 97.27.97.67.77 97.27.97.67.77.47 97.27.97.67.77.47.7 27.97.67.77.47.7.47 97.67.77.47.7.47.87 67.77.47.7.47.87.37 77.47.7.47.87.37.87 47.7.47.87.37.87.77 7.47.87.37.87.77.7 47.87.37.87.77.7.57 87.37.87.77.7.57.47 37.87.77.7.57.47.47 87.77.7.57.47.47.37 77.7.57.47.47.37.27 7.57.47.47.37.27.17 57.47.47.37.27.17.7 47.47.37.27.17.7 47.37.27.17.7 38.68.78 38.68.78.8 38.68.78.8.28 38.68.78.8.28.98 38.68.78.8.28.98.78 68.78.8.28.98.78.58 78.8.28.98.78.58.98 8.28.98.78.58.98.8 28.98.78.58.98.8.88 98.78.58.98.8.88.8 78.58.98.8.88.8.58 58.98.8.88.8.58.58 98.8.88.8.58.58.58 8.88.8.58.58.58.38 88.8.58.58.58.38 8.58.58.58.38 99.89.59 99.89.59.39 99.89.59.39.99 99.89.59.39.99.29 99.89.59.39.99.29.59 89.59.39.99.29.59.89 59.39.99.29.59.89.89 39.99.29.59.89.89.29 99.29.59.89.89.29.9 29.59.89.89.29.9.79 59.89.89.29.9.79.49 89.89.29.9.79.49.59 89.29.9.79.49.59.29 29.9.79.49.59.29.59 9.79.49.59.29.59.19 79.49.59.29.59.19.39 49.59.29.59.19.39.9 59.29.59.19.39.9.9 29.59.19.39.9.9.99 59.19.39.9.9.99.69 19.39.9.9.99.69.39 39.9.9.99.69.39 9.9.99
do_execsql_test 1.11.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0.1.1 0.1.1.2 0.1.1.2.2 0.1.1.2.2.2 0.1.1.2.2.2.3 1.1.2.2.2.3.3 1.2.2.2.3.3.4 2.2.2.3.3.4.5 2.2.3.3.4.5.5 2.3.3.4.5.5.6 3.3.4.5.5.6.7 3.4.5.5.6.7.7 4.5.5.6.7.7.7 5.5.6.7.7.7.8 5.6.7.7.7.8.8 6.7.7.7.8.8.8 7.7.7.8.8.8.9 7.7.8.8.8.9.9 7.8.8.8.9.9.9 8.8.8.9.9.9.10 8.8.9.9.9.10.11 8.9.9.9.10.11.11 9.9.9.10.11.11.12 9.9.10.11.11.12.12 9.10.11.11.12.12.12 10.11.11.12.12.12.13 11.11.12.12.12.13.13 11.12.12.12.13.13.14 12.12.12.13.13.14.15 12.12.13.13.14.15.15 12.13.13.14.15.15.15 13.13.14.15.15.15.16 13.14.15.15.15.16.16 14.15.15.15.16.16.16 15.15.15.16.16.16.17 15.15.16.16.16.17.19 15.16.16.16.17.19.20 16.16.16.17.19.20.21 16.16.17.19.20.21.21 16.17.19.20.21.21.22 17.19.20.21.21.22.22 19.20.21.21.22.22.23 20.21.21.22.22.23.23 21.21.22.22.23.23.23 21.22.22.23.23.23.24 22.22.23.23.23.24.25 22.23.23.23.24.25.26 23.23.23.24.25.26.26 23.23.24.25.26.26.26 23.24.25.26.26.26.27 24.25.26.26.26.27.27 25.26.26.26.27.27.28 26.26.26.27.27.28.29 26.26.27.27.28.29.29 26.27.27.28.29.29.29 27.27.28.29.29.29.30 27.28.29.29.29.30.30 28.29.29.29.30.30.30 29.29.29.30.30.30.31 29.29.30.30.30.31.31 29.30.30.30.31.31.32 30.30.30.31.31.32.33 30.30.31.31.32.33.33 30.31.31.32.33.33.33 31.31.32.33.33.33.33 31.32.33.33.33.33.33 32.33.33.33.33.33.34 33.33.33.33.33.34.34 33.33.33.33.34.34.34 33.33.33.34.34.34.34 33.33.34.34.34.34.35 33.34.34.34.34.35.35 34.34.34.34.35.35.36 34.34.34.35.35.36.36 34.34.35.35.36.36.36 34.35.35.36.36.36.36 35.35.36.36.36.36.37 35.36.36.36.36.37.37 36.36.36.36.37.37.38 36.36.36.37.37.38.38 36.36.37.37.38.38.39 36.37.37.38.38.39.39 37.37.38.38.39.39.39 37.38.38.39.39.39.40 38.38.39.39.39.40.41 38.39.39.39.40.41.41 39.39.39.40.41.41.41 39.39.40.41.41.41.42 39.40.41.41.41.42.43 40.41.41.41.42.43.43 41.41.41.42.43.43.44 41.41.42.43.43.44.44 41.42.43.43.44.44.46 42.43.43.44.44.46.46 43.43.44.44.46.46.47 43.44.44.46.46.47.47 44.44.46.46.47.47.47 44.46.46.47.47.47.47 46.46.47.47.47.47.49 46.47.47.47.47.49.50 47.47.47.47.49.50.51 47.47.47.49.50.51.52 47.47.49.50.51.52.53 47.49.50.51.52.53.54 49.50.51.52.53.54.55 50.51.52.53.54.55.55 51.52.53.54.55.55.56 52.53.54.55.55.56.56 53.54.55.55.56.56.56 54.55.55.56.56.56.57 55.55.56.56.56.57.58 55.56.56.56.57.58.58 56.56.56.57.58.58.58 56.56.57.58.58.58.58 56.57.58.58.58.58.59 57.58.58.58.58.59.59 58.58.58.58.59.59.59 58.58.58.59.59.59.59 58.58.59.59.59.59.60 58.59.59.59.59.60.61 59.59.59.59.60.61.61 59.59.59.60.61.61.62 59.59.60.61.61.62.62 59.60.61.61.62.62.63 60.61.61.62.62.63.64 61.61.62.62.63.64.65 61.62.62.63.64.65.65 62.62.63.64.65.65.65 62.63.64.65.65.65.66 63.64.65.65.65.66.67 64.65.65.65.66.67.68 65.65.65.66.67.68.69 65.65.66.67.68.69.70 65.66.67.68.69.70.72 66.67.68.69.70.72.72 67.68.69.70.72.72.72 68.69.70.72.72.72.73 69.70.72.72.72.73.73 70.72.72.72.73.73.73 72.72.72.73.73.73.74 72.72.73.73.73.74.74 72.73.73.73.74.74.74 73.73.73.74.74.74.74 73.73.74.74.74.74.74 73.74.74.74.74.74.75 74.74.74.74.74.75.75 74.74.74.74.75.75.75 74.74.74.75.75.75.76 74.74.75.75.75.76.77 74.75.75.75.76.77.77 75.75.75.76.77.77.78 75.75.76.77.77.78.78 75.76.77.77.78.78.79 76.77.77.78.78.79.80 77.77.78.78.79.80.80 77.78.78.79.80.80.81 78.78.79.80.80.81.81 78.79.80.80.81.81.81 79.80.80.81.81.81.82 80.80.81.81.81.82.83 80.81.81.81.82.83.84 81.81.81.82.83.84.84 81.81.82.83.84.84.84 81.82.83.84.84.84.84 82.83.84.84.84.84.85 83.84.84.84.84.85.85 84.84.84.84.85.85.85 84.84.84.85.85.85.86 84.84.85.85.85.86.87 84.85.85.85.86.87.87 85.85.85.86.87.87.88 85.85.86.87.87.88.89 85.86.87.87.88.89.89 86.87.87.88.89.89.89 87.87.88.89.89.89.90 87.88.89.89.89.90.90 88.89.89.89.90.90.90 89.89.89.90.90.90.91 89.89.90.90.90.91.91 89.90.90.90.91.91.91 90.90.90.91.91.91.91 90.90.91.91.91.91.91 90.91.91.91.91.91.93 91.91.91.91.91.93.93 91.91.91.91.93.93.93 91.91.91.93
do_execsql_test 1.11.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0.10.20 0.10.20.30 0.10.20.30.30 0.10.20.30.30.30 0.10.20.30.30.30.40 10.20.30.30.30.40.50 20.30.30.30.40.50.60 30.30.30.40.50.60.70 30.30.40.50.60.70.80 30.40.50.60.70.80.80 40.50.60.70.80.80.90 50.60.70.80.80.90.90 60.70.80.80.90.90.90 70.80.80.90.90.90 80.80.90.90.90 1.1.11 1.1.11.11 1.1.11.11.21 1.1.11.11.21.21 1.1.11.11.21.21.31 1.11.11.21.21.31.31 11.11.21.21.31.31.41 11.21.21.31.31.41.41 21.21.31.31.41.41.41 21.31.31.41.41.41.51 31.31.41.41.41.51.61 31.41.41.41.51.61.61 41.41.41.51.61.61.81 41.41.51.61.61.81.81 41.51.61.61.81.81.81 51.61.61.81.81.81.91 61.61.81.81.81.91.91 61.81.81.81.91.91.91 81.81.81.91.91.91.91 81.81.91.91.91.91.91 81.91.91.91.91.91 91.91.91.91.91 2.2.2 2.2.2.12 2.2.2.12.12 2.2.2.12.12.12 2.2.2.12.12.12.22 2.2.12.12.12.22.22 2.12.12.12.22.22.32 12.12.12.22.22.32.42 12.12.22.22.32.42.52 12.22.22.32.42.52.62 22.22.32.42.52.62.62 22.32.42.52.62.62.72 32.42.52.62.62.72.72 42.52.62.62.72.72.72 52.62.62.72.72.72.82 62.62.72.72.72.82 62.72.72.72.82 3.3.13 3.3.13.13 3.3.13.13.23 3.3.13.13.23.23 3.3.13.13.23.23.23 3.13.13.23.23.23.33 13.13.23.23.23.33.33 13.23.23.23.33.33.33 23.23.23.33.33.33.33 23.23.33.33.33.33.33 23.33.33.33.33.33.43 33.33.33.33.33.43.43 33.33.33.33.43.43.53 33.33.33.43.43.53.63 33.33.43.43.53.63.73 33.43.43.53.63.73.73 43.43.53.63.73.73.73 43.53.63.73.73.73.83 53.63.73.73.73.83.93 63.73.73.73.83.93.93 73.73.73.83.93.93.93 73.73.83.93.93.93 73.83.93.93.93 4.14.24 4.14.24.34 4.14.24.34.34 4.14.24.34.34.34 4.14.24.34.34.34.34 14.24.34.34.34.34.44 24.34.34.34.34.44.44 34.34.34.34.44.44.54 34.34.34.44.44.54.64 34.34.44.44.54.64.74 34.44.44.54.64.74.74 44.44.54.64.74.74.74 44.54.64.74.74.74.74 54.64.74.74.74.74.74 64.74.74.74.74.74.84 74.74.74.74.74.84.84 74.74.74.74.84.84.84 74.74.74.84.84.84.84 74.74.84.84.84.84.94 74.84.84.84.84.94 84.84.84.84.94 5.5.15 5.5.15.15 5.5.15.15.15 5.5.15.15.15.25 5.5.15.15.15.25.35 5.15.15.15.25.35.35 15.15.15.25.35.35.55 15.15.25.35.35.55.55 15.25.35.35.55.55.65 25.35.35.55.55.65.65 35.35.55.55.65.65.65 35.55.55.65.65.65.75 55.55.65.65.65.75.75 55.65.65.65.75.75.75 65.65.65.75.75.75.85 65.65.75.75.75.85.85 65.75.75.75.85.85.85 75.75.75.85.85.85.95 75.75.85.85.85.95.95 75.85.85.85.95.95.95 85.85.85.95.95.95 85.85.95.95.95 6.16.16 6.16.16.16 6.16.16.16.26 6.16.16.16.26.26 6.16.16.16.26.26.26 16.16.16.26.26.26.36 16.16.26.26.26.36.36 16.26.26.26.36.36.36 26.26.26.36.36.36.36 26.26.36.36.36.36.46 26.36.36.36.36.46.46 36.36.36.36.46.46.56 36.36.36.46.46.56.56 36.36.46.46.56.56.56 36.46.46.56.56.56.66 46.46.56.56.56.66.76 46.56.56.56.66.76.86 56.56.56.66.76.86.96 56.56.66.76.86.96.96 56.66.76.86.96.96.96 66.76.86.96.96.96 76.86.96.96.96 7.7.7 7.7.7.17 7.7.7.17.27 7.7.7.17.27.27 7.7.7.17.27.27.37 7.7.17.27.27.37.37 7.17.27.27.37.37.47 17.27.27.37.37.47.47 27.27.37.37.47.47.47 27.37.37.47.47.47.47 37.37.47.47.47.47.57 37.47.47.47.47.57.67 47.47.47.47.57.67.77 47.47.47.57.67.77.77 47.47.57.67.77.77.87 47.57.67.77.77.87.87 57.67.77.77.87.87.97 67.77.77.87.87.97.97 77.77.87.87.97.97 77.87.87.97.97 8.8.8 8.8.8.28 8.8.8.28.38 8.8.8.28.38.38 8.8.8.28.38.38.58 8.8.28.38.38.58.58 8.28.38.38.58.58.58 28.38.38.58.58.58.58 38.38.58.58.58.58.68 38.58.58.58.58.68.78 58.58.58.58.68.78.78 58.58.58.68.78.78.88 58.58.68.78.78.88.98 58.68.78.78.88.98.98 68.78.78.88.98.98 78.78.88.98.98 9.9.9 9.9.9.19 9.9.9.19.29 9.9.9.19.29.29 9.9.9.19.29.29.29 9.9.19.29.29.29.39 9.19.29.29.29.39.39 19.29.29.29.39.39.39 29.29.29.39.39.39.49 29.29.39.39.39.49.59 29.39.39.39.49.59.59 39.39.39.49.59.59.59 39.39.49.59.59.59.59 39.49.59.59.59.59.69 49.59.59.59.59.69.79 59.59.59.59.69.79.89 59.59.59.69.79.89.89 59.59.69.79.89.89.89 59.69.79.89.89.89.99 69.79.89.89.89.99.99 79.89.89.89.99.99.99 89.89.89.99.99.9
do_execsql_test 1.11.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING ) FROM t2
} {0.90.40 0.90.40.30 0.90.40.30.80 0.90.40.30.80.20 0.90.40.30.80.20.90 90.40.30.80.20.90.60 40.30.80.20.90.60.70 30.80.20.90.60.70.80 80.20.90.60.70.80.90 20.90.60.70.80.90.30 90.60.70.80.90.30.50 60.70.80.90.30.50.10 70.80.90.30.50.10.30 80.90.30.50.10.30.41 90.30.50.10.30.41.81 30.50.10.30.41.81.91 50.10.30.41.81.91.61 10.30.41.81.91.61.91 30.41.81.91.61.91.91 41.81.91.61.91.91.1 81.91.61.91.91.1.81 91.61.91.91.1.81.41 61.91.91.1.81.41.61 91.91.1.81.41.61.1 91.1.81.41.61.1.21 1.81.41.61.1.21.11 81.41.61.1.21.11.51 41.61.1.21.11.51.41 61.1.21.11.51.41.31 1.21.11.51.41.31.31 21.11.51.41.31.31.11 11.51.41.31.31.11.81 51.41.31.31.11.81.91 41.31.31.11.81.91.91 31.31.11.81.91.91.21 31.11.81.91.91.21.2 11.81.91.91.21.2.62 81.91.91.21.2.62.12 91.91.21.2.62.12.32 91.21.2.62.12.32.22 21.2.62.12.32.22.42 2.62.12.32.22.42.2 62.12.32.22.42.2.72 12.32.22.42.2.72.12 32.22.42.2.72.12.22 22.42.2.72.12.22.2 42.2.72.12.22.2.72 2.72.12.22.2.72.72 72.12.22.2.72.72.12 12.22.2.72.72.12.62 22.2.72.72.12.62.52 2.72.72.12.62.52.82 72.72.12.62.52.82.23 72.12.62.52.82.23.33 12.62.52.82.23.33.93 62.52.82.23.33.93.23 52.82.23.33.93.23.93 82.23.33.93.23.93.43 23.33.93.23.93.43.3 33.93.23.93.43.3.43 93.23.93.43.3.43.33 23.93.43.3.43.33.53 93.43.3.43.33.53.63 43.3.43.33.53.63.73 3.43.33.53.63.73.13 43.33.53.63.73.13.73 33.53.63.73.13.73.73 53.63.73.13.73.73.33 63.73.13.73.73.33.93 73.13.73.73.33.93.23 13.73.73.33.93.23.13 73.73.33.93.23.13.33 73.33.93.23.13.33.3 33.93.23.13.33.3.33 93.23.13.33.3.33.83 23.13.33.3.33.83.74 13.33.3.33.83.74.74 33.3.33.83.74.74.54 3.33.83.74.74.54.84 33.83.74.74.54.84.74 83.74.74.54.84.74.24 74.74.54.84.74.24.4 74.54.84.74.24.4.94 54.84.74.24.4.94.84 84.74.24.4.94.84.74 74.24.4.94.84.74.34 24.4.94.84.74.34.34 4.94.84.74.34.34.44 94.84.74.34.34.44.74 84.74.34.34.44.74.64 74.34.34.44.74.64.14 34.34.44.74.64.14.34 34.44.74.64.14.34.84 44.74.64.14.34.84.84 74.64.14.34.84.84.44 64.14.34.84.84.44.34 14.34.84.84.44.34.65 34.84.84.44.34.65.35 84.84.44.34.65.35.85 84.44.34.65.35.85.85 44.34.65.35.85.85.55 34.65.35.85.85.55.15 65.35.85.85.55.15.25 35.85.85.55.15.25.75 85.85.55.15.25.75.95 85.55.15.25.75.95.65 55.15.25.75.95.65.65 15.25.75.95.65.65.35 25.75.95.65.65.35.5 75.95.65.65.35.5.15 95.65.65.35.5.15.95 65.65.35.5.15.95.55 65.35.5.15.95.55.75 35.5.15.95.55.75.85 5.15.95.55.75.85.75 15.95.55.75.85.75.15 95.55.75.85.75.15.95 55.75.85.75.15.95.5 75.85.75.15.95.5.26 85.75.15.95.5.26.96 75.15.95.5.26.96.46 15.95.5.26.96.46.6 95.5.26.96.46.6.46 5.26.96.46.6.46.16 26.96.46.6.46.16.16 96.46.6.46.16.16.86 46.6.46.16.16.86.56 6.46.16.16.86.56.56 46.16.16.86.56.56.56 16.16.86.56.56.56.16 16.86.56.56.56.16.36 86.56.56.56.16.36.76 56.56.56.16.36.76.96 56.56.16.36.76.96.96 56.16.36.76.96.96.26 16.36.76.96.96.26.26 36.76.96.96.26.26.36 76.96.96.26.26.36.66 96.96.26.26.36.66.36 96.26.26.36.66.36.36 26.26.36.66.36.36.97 26.36.66.36.36.97.27 36.66.36.36.97.27.97 66.36.36.97.27.97.67 36.36.97.27.97.67.77 36.97.27.97.67.77.47 97.27.97.67.77.47.7 27.97.67.77.47.7.47 97.67.77.47.7.47.87 67.77.47.7.47.87.37 77.47.7.47.87.37.87 47.7.47.87.37.87.77 7.47.87.37.87.77.7 47.87.37.87.77.7.57 87.37.87.77.7.57.47 37.87.77.7.57.47.47 87.77.7.57.47.47.37 77.7.57.47.47.37.27 7.57.47.47.37.27.17 57.47.47.37.27.17.7 47.47.37.27.17.7.38 47.37.27.17.7.38.68 37.27.17.7.38.68.78 27.17.7.38.68.78.8 17.7.38.68.78.8.28 7.38.68.78.8.28.98 38.68.78.8.28.98.78 68.78.8.28.98.78.58 78.8.28.98.78.58.98 8.28.98.78.58.98.8 28.98.78.58.98.8.88 98.78.58.98.8.88.8 78.58.98.8.88.8.58 58.98.8.88.8.58.58 98.8.88.8.58.58.58 8.88.8.58.58.58.38 88.8.58.58.58.38.99 8.58.58.58.38.99.89 58.58.58.38.99.89.59 58.58.38.99.89.59.39 58.38.99.89.59.39.99 38.99.89.59.39.99.29 99.89.59.39.99.29.59 89.59.39.99.29.59.89 59.39.99.29.59
do_execsql_test 1.11.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.11.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING)
} {3 74 4 74.74 5 74.74 6 74.74.99 7 74.74.99 7 74.74.99.33 7 74.99.33 7 74.99.33.89 7 99.33.89 7 99.33.89.96 7 33.89.96 7 33.89.96.38 7 89.96.38 7 89.96.38.39 7 96.38.39 7 96.38.39.91 7 38.39.91 7 38.39.91.6 7 39.91.6 7 39.91.6.97 7 91.6.97 7 91.6.97.46 7 6.97.46 7 6.97.46.54 7 97.46.54 7 97.46.54.8 7 46.54.8 7 46.54.8.29 7 54.8.29 7 54.8.29.84 7 8.29.84 7 8.29.84.23 7 29.84.23 7 29.84.23.16 7 84.23.16 7 84.23.16.65 7 23.16.65 7 23.16.65.47 7 16.65.47 7 16.65.47.86 7 65.47.86 7 65.47.86.61 7 47.86.61 7 47.86.61.85 7 86.61.85 7 86.61.85.85 7 61.85.85 7 61.85.85.59 7 85.85.59 7 85.85.59.32 7 85.59.32 7 85.59.32.3 7 59.32.3 7 59.32.3.22 7 32.3.22 7 32.3.22.55 7 3.22.55 7 3.22.55.28 7 22.55.28 7 22.55.28.25 7 55.28.25 7 55.28.25.1 7 28.25.1 7 28.25.1.40 7 25.1.40 7 25.1.40.56 7 1.40.56 7 1.40.56.75 7 40.56.75 7 40.56.75.89 7 56.75.89 7 56.75.89.76 7 75.89.76 7 75.89.76.4 7 89.76.4 7 89.76.4.42 7 76.4.42 7 76.4.42.78 7 4.42.78 7 4.42.78.29 7 42.78.29 7 42.78.29.63 7 78.29.63 7 78.29.63.87 7 29.63.87 7 29.63.87.80 7 63.87.80 7 63.87.80.72 7 87.80.72 7 87.80.72.9 7 80.72.9 7 80.72.9.73 7 72.9.73 7 72.9.73.65 7 9.73.65 7 9.73.65.58 7 73.65.58 7 73.65.58.98 7 65.58.98 7 65.58.98.21 7 58.98.21 7 58.98.21.65 7 98.21.65 7 98.21.65.5 7 21.65.5 7 21.65.5.11 7 65.5.11 7 65.5.11.87 7 5.11.87 7 5.11.87.12 7 11.87.12 7 11.87.12.20 7 87.12.20 7 87.12.20.31 7 12.20.31 7 12.20.31.95 7 20.31.95 7 20.31.95.73 7 31.95.73 7 31.95.73.88 7 95.73.88 7 95.73.88.8 7 73.88.8 7 73.88.8.49 7 88.8.49 7 88.8.49.90 7 8.49.90 7 8.49.90.96 7 49.90.96 7 49.90.96.55 7 90.96.55 7 90.96.55.77 7 96.55.77 7 96.55.77.2 7 55.77.2 7 55.77.2.85 7 77.2.85 7 77.2.85.74 7 2.85.74 7 2.85.74.70 7 85.74.70 7 85.74.70.19 7 74.70.19 7 74.70.19.26 7 70.19.26 7 70.19.26.47 7 19.26.47 7 19.26.47.90 7 26.47.90 7 26.47.90.58 7 47.90.58 7 47.90.58.9 7 90.58.9 7 90.58.9.72 7 58.9.72 7 58.9.72.33 7 9.72.33 7 9.72.33.75 7 72.33.75 7 72.33.75.81 7 33.75.81 7 33.75.81.23 7 75.81.23 7 75.81.23.13 7 81.23.13 7 81.23.13.14 7 23.13.14 7 23.13.14.91 7 13.14.91 7 13.14.91.91 7 14.91.91 7 14.91.91.15 7 91.91.15 7 91.91.15.36 7 91.15.36 7 91.15.36.3 7 15.36.3 7 15.36.3.69 7 36.3.69 7 36.3.69.52 7 3.69.52 7 3.69.52.50 7 69.52.50 7 69.52.50.10 7 52.50.10 7 52.50.10.33 7 50.10.33 7 50.10.33.39 7 10.33.39 7 10.33.39.58 7 33.39.58 7 33.39.58.38 7 39.58.38 7 39.58.38.83 7 58.38.83 7 58.38.83.82 7 38.83.82 7 38.83.82.7 7 83.82.7 6 83.82.7 5 82.7}
do_execsql_test 1.11.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING)
} {3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {}}
do_execsql_test 1.11.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING)
} {3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {}}
do_execsql_test 1.11.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 PRECEDING AND 2 FOLLOWING)
} {3 89.6.29 4 89.6.29.47 5 89.6.29.47.59 6 89.6.29.47.59.28 7 89.6.29.47.59.28.75 7 6.29.47.59.28.75.78 7 29.47.59.28.75.78.72 7 47.59.28.75.78.72.98 7 59.28.75.78.72.98.87 7 28.75.78.72.98.87.73 7 75.78.72.98.87.73.96 7 78.72.98.87.73.96.74 7 72.98.87.73.96.74.90 7 98.87.73.96.74.90.75 7 87.73.96.74.90.75.91 7 73.96.74.90.75.91.69 7 96.74.90.75.91.69.39 7 74.90.75.91.69.39.7 6 90.75.91.69.39.7 5 75.91.69.39.7 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 74.96.97 4 74.96.97.84 5 74.96.97.84.86 6 74.96.97.84.86.32 7 74.96.97.84.86.32.25 7 96.97.84.86.32.25.89 7 97.84.86.32.25.89.29 7 84.86.32.25.89.29.9 7 86.32.25.89.29.9.21 7 32.25.89.29.9.21.12 7 25.89.29.9.21.12.88 7 89.29.9.21.12.88.55 7 29.9.21.12.88.55.70 7 9.21.12.88.55.70.58 7 21.12.88.55.70.58.81 7 12.88.55.70.58.81.91 7 88.55.70.58.81.91.52 7 55.70.58.81.91.52.58 6 70.58.81.91.52.58 5 58.81.91.52.58 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 74.38.46 4 74.38.46.23 5 74.38.46.23.61 6 74.38.46.23.61.3 7 74.38.46.23.61.3.1 7 38.46.23.61.3.1.76 7 46.23.61.3.1.76.63 7 23.61.3.1.76.63.73 7 61.3.1.76.63.73.65 7 3.1.76.63.73.65.20 7 1.76.63.73.65.20.8 7 76.63.73.65.20.8.77 7 63.73.65.20.8.77.19 7 73.65.20.8.77.19.9 7 65.20.8.77.19.9.23 7 20.8.77.19.9.23.15 7 8.77.19.9.23.15.50 7 77.19.9.23.15.50.38 6 19.9.23.15.50.38 5 9.23.15.50.38 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 99.39.54 4 99.39.54.16 5 99.39.54.16.85 6 99.39.54.16.85.22 7 99.39.54.16.85.22.40 7 39.54.16.85.22.40.4 7 54.16.85.22.40.4.87 7 16.85.22.40.4.87.65 7 85.22.40.4.87.65.5 7 22.40.4.87.65.5.31 7 40.4.87.65.5.31.49 7 4.87.65.5.31.49.2 7 87.65.5.31.49.2.26 7 65.5.31.49.2.26.72 7 5.31.49.2.26.72.13 7 31.49.2.26.72.13.36 7 49.2.26.72.13.36.10 7 2.26.72.13.36.10.83 6 26.72.13.36.10.83 5 72.13.36.10.83 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {} 3 33.91.8 4 33.91.8.65 5 33.91.8.65.85 6 33.91.8.65.85.55 7 33.91.8.65.85.55.56 7 91.8.65.85.55.56.42 7 8.65.85.55.56.42.80 7 65.85.55.56.42.80.58 7 85.55.56.42.80.58.11 7 55.56.42.80.58.11.95 7 56.42.80.58.11.95.90 7 42.80.58.11.95.90.85 7 80.58.11.95.90.85.47 7 58.11.95.90.85.47.33 7 11.95.90.85.47.33.14 7 95.90.85.47.33.14.3 7 90.85.47.33.14.3.33 7 85.47.33.14.3.33.82 6 47.33.14.3.33.82 5 33.14.3.33.82 3 {} 4 {} 5 {} 6 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 7 {} 6 {} 5 {}}
do_execsql_test 1.12.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {74 99 99 99 99 99 89 96 96 96 96 96 68 91 91 91 99 99 99 99 99 97 97 97 97 97 97 93 93 93 93 84 93 93 93 93 93 86 86 86 91 91 91 91 91 85 85 85 59 59 91 91 91 91 91 90 90 89 89 89 89 56 56 56 56 75 75 89 98 98 98 98 98 94 94 94 94 78 78 78 63 87 87 87 87 87 84 84 84 73 95 95 95 95 96 98 98 98 98 98 74 74 74 73 73 87 87 87 87 87 41 31 31 95 95 95 95 95 88 88 88 88 49 90 90 96 96 96 96 96 77 77 77 85 85 85 85 85 74 74 70 70 59 47 80 90 90 90 90 90 72 72 72 72 93 93 93 93 93 81 81 81 37 37 62 91 91 91 91 91 91 91 99 99 99 99 99 95 95 69 84 84 84 84 84 84 84 58 58 58 58 83 83 83 83 83 82 82 17 7 5}
do_execsql_test 1.12.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 23 23 23 2 2 2 2 2 38 38 38 38 38 39 6 6 6 6 6 27 27 27 8 8 8 8 8 29 23 16 16 16 16 16 16 7 7 7 7 7 61 24 24 24 24 12 12 12 3 3 3 3 3 15 15 15 15 15 1 1 1 1 1 16 16 16 16 16 36 36 4 4 4 4 4 30 29 29 29 2 2 2 2 2 37 37 9 9 9 9 9 13 13 13 13 1 1 1 1 1 5 5 5 5 5 11 11 8 8 8 8 8 15 15 15 15 22 22 8 8 8 8 8 11 34 34 55 55 55 44 2 2 2 2 2 7 29 29 19 19 19 19 19 26 26 26 36 36 9 9 9 9 9 33 33 33 33 9 9 9 9 9 12 12 12 12 14 33 15 15 15 15 3 3 3 3 3 30 30 30 10 10 10 10 10 21 21 21 30 30 30 27 27 17 7 5 5 5 5 5}
do_execsql_test 1.12.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.12.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.12.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.12.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.12.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.12.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.12.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.12.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.12.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.12.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.12.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.12.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.12.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.12.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.12.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.12.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.12.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.12.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.12.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206 206 206 206 206}
do_execsql_test 1.12.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {168 134 218 191 212 229 240 213 234 196 223 223 223 223 223 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 210 210 210 210 78 120 87 162 124 141 138 227 228 179 231 234 280 280 280 280 280 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 279 279 279 279 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 229 229 229 229 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 206 206 206 206 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 212 212 212 212 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 207 207 207 207 88 171 158 156 198 121 210 132 210 239 250 232 232 232 232 232 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229 229 229 229 229}
do_execsql_test 1.12.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276 276 276 276 276}
do_execsql_test 1.12.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {213 223 106 234 191 212 168 229 147 218 240 240 240 240 240 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 263 263 263 263 124 179 78 141 84 120 234 79 231 162 227 228 280 280 280 280 280 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 252 252 252 252 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 171 171 171 171 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 274 274 274 274 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 226 226 226 226 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 124 124 124 124 52 232 156 210 239 250 83 103 158 210 171 198 198 198 198 198 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276 276 276 276 276}
do_execsql_test 1.12.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229 229 229 229 229}
do_execsql_test 1.12.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.12.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} {} {} 56 {} {} {} {} {} {} {} {} {} {} {} 78 {} {} {} {} {} {} {} {} 37 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} {} {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 13 23 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} {} {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.12.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.12.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99}
do_execsql_test 1.12.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 10 20 30 30 30 40 50 60 70 80 80 90 90 90 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 2 2 2 12 12 12 22 22 32 42 52 62 62 72 72 72 82 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 8 8 8 28 38 38 58 58 58 58 68 78 78 88 98 98 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99}
do_execsql_test 1.12.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.12.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.12.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.12.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.12.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.12.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.12.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.12.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0.74.41.74.23 74.41.74.23.99 41.74.23.99.26 74.23.99.26.33 23.99.26.33.2 99.26.33.2.89 26.33.2.89.81 33.2.89.81.96 2.89.81.96.59 89.81.96.59.38 81.96.59.38.68 96.59.38.68.39 59.38.68.39.62 38.68.39.62.91 68.39.62.91.46 39.62.91.46.6 62.91.46.6.99 91.46.6.99.97 46.6.99.97.27 6.99.97.27.46 99.97.27.46.78 97.27.46.78.54 27.46.78.54.97 46.78.54.97.8 78.54.97.8.67 54.97.8.67.29 97.8.67.29.93 8.67.29.93.84 67.29.93.84.77 29.93.84.77.23 93.84.77.23.16 84.77.23.16.16 77.23.16.16.93 23.16.16.93.65 16.16.93.65.35 16.93.65.35.47 93.65.35.47.7 65.35.47.7.86 35.47.7.86.74 47.7.86.74.61 7.86.74.61.91 86.74.61.91.85 74.61.91.85.24 61.91.85.24.85 91.85.24.85.43 85.24.85.43.59 24.85.43.59.12 85.43.59.12.32 43.59.12.32.56 59.12.32.56.3 12.32.56.3.91 32.56.3.91.22 56.3.91.22.90 3.91.22.90.55 91.22.90.55.15 22.90.55.15.28 90.55.15.28.89 55.15.28.89.25 15.28.89.25.47 28.89.25.47.1 89.25.47.1.56 25.47.1.56.40 47.1.56.40.43 1.56.40.43.56 56.40.43.56.16 40.43.56.16.75 43.56.16.75.36 56.16.75.36.89 16.75.36.89.98 75.36.89.98.76 36.89.98.76.81 89.98.76.81.4 98.76.81.4.94 76.81.4.94.42 81.4.94.42.30 4.94.42.30.78 94.42.30.78.33 42.30.78.33.29 30.78.33.29.53 78.33.29.53.63 33.29.53.63.2 29.53.63.2.87 53.63.2.87.37 63.2.87.37.80 2.87.37.80.84 87.37.80.84.72 37.80.84.72.41 80.84.72.41.9 84.72.41.9.61 72.41.9.61.73 41.9.61.73.95 9.61.73.95.65 61.73.95.65.13 73.95.65.13.58 95.65.13.58.96 65.13.58.96.98 13.58.96.98.1 58.96.98.1.21 96.98.1.21.74 98.1.21.74.65 1.21.74.65.35 21.74.65.35.5 74.65.35.5.73 65.35.5.73.11 35.5.73.11.51 5.73.11.51.87 73.11.51.87.41 11.51.87.41.12 51.87.41.12.8 87.41.12.8.20 41.12.8.20.31 12.8.20.31.31 8.20.31.31.15 20.31.31.15.95 31.31.15.95.22 31.15.95.22.73 15.95.22.73.79 95.22.73.79.88 22.73.79.88.34 73.79.88.34.8 79.88.34.8.11 88.34.8.11.49 34.8.11.49.34 8.11.49.34.90 11.49.34.90.59 49.34.90.59.96 34.90.59.96.60 90.59.96.60.55 59.96.60.55.75 96.60.55.75.77 60.55.75.77.44 55.75.77.44.2 75.77.44.2.7 77.44.2.7.85 44.2.7.85.57 2.7.85.57.74 7.85.57.74.29 85.57.74.29.70 57.74.29.70.59 74.29.70.59.19 29.70.59.19.39 70.59.19.39.26 59.19.39.26.26 19.39.26.26.47 39.26.26.47.80 26.26.47.80.90 26.47.80.90.36 47.80.90.36.58 80.90.36.58.47 90.36.58.47.9 36.58.47.9.72 58.47.9.72.72 47.9.72.72.66 9.72.72.66.33 72.72.66.33.93 72.66.33.93.75 66.33.93.75.64 33.93.75.64.81 93.75.64.81.9 75.64.81.9.23 64.81.9.23.37 81.9.23.37.13 9.23.37.13.12 23.37.13.12.14 37.13.12.14.62 13.12.14.62.91 12.14.62.91.36 14.62.91.36.91 62.91.36.91.33 91.36.91.33.15 36.91.33.15.34 91.33.15.34.36 33.15.34.36.99 15.34.36.99.3 34.36.99.3.95 36.99.3.95.69 99.3.95.69.58 3.95.69.58.52 95.69.58.52.30 69.58.52.30.50 58.52.30.50.84 52.30.50.84.10 30.50.84.10.84 50.84.10.84.33 84.10.84.33.21 10.84.33.21.39 84.33.21.39.44 33.21.39.44.58 21.39.44.58.30 39.44.58.30.38 44.58.30.38.34 58.30.38.34.83 30.38.34.83.27 38.34.83.27.82 34.83.27.82.17 83.27.82.17.7 27.82.17.7.5 82.17.7.5 17.7.5 7.5 5}
do_execsql_test 1.12.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0.90.40.30.80 90.40.30.80.20 40.30.80.20.90 30.80.20.90.60 80.20.90.60.70 20.90.60.70.80 90.60.70.80.90 60.70.80.90.30 70.80.90.30.50 80.90.30.50.10 90.30.50.10.30 30.50.10.30 50.10.30 10.30 30 41.81.91.61.91 81.91.61.91.91 91.61.91.91.1 61.91.91.1.81 91.91.1.81.41 91.1.81.41.61 1.81.41.61.1 81.41.61.1.21 41.61.1.21.11 61.1.21.11.51 1.21.11.51.41 21.11.51.41.31 11.51.41.31.31 51.41.31.31.11 41.31.31.11.81 31.31.11.81.91 31.11.81.91.91 11.81.91.91.21 81.91.91.21 91.91.21 91.21 21 2.62.12.32.22 62.12.32.22.42 12.32.22.42.2 32.22.42.2.72 22.42.2.72.12 42.2.72.12.22 2.72.12.22.2 72.12.22.2.72 12.22.2.72.72 22.2.72.72.12 2.72.72.12.62 72.72.12.62.52 72.12.62.52.82 12.62.52.82 62.52.82 52.82 82 23.33.93.23.93 33.93.23.93.43 93.23.93.43.3 23.93.43.3.43 93.43.3.43.33 43.3.43.33.53 3.43.33.53.63 43.33.53.63.73 33.53.63.73.13 53.63.73.13.73 63.73.13.73.73 73.13.73.73.33 13.73.73.33.93 73.73.33.93.23 73.33.93.23.13 33.93.23.13.33 93.23.13.33.3 23.13.33.3.33 13.33.3.33.83 33.3.33.83 3.33.83 33.83 83 74.74.54.84.74 74.54.84.74.24 54.84.74.24.4 84.74.24.4.94 74.24.4.94.84 24.4.94.84.74 4.94.84.74.34 94.84.74.34.34 84.74.34.34.44 74.34.34.44.74 34.34.44.74.64 34.44.74.64.14 44.74.64.14.34 74.64.14.34.84 64.14.34.84.84 14.34.84.84.44 34.84.84.44.34 84.84.44.34 84.44.34 44.34 34 65.35.85.85.55 35.85.85.55.15 85.85.55.15.25 85.55.15.25.75 55.15.25.75.95 15.25.75.95.65 25.75.95.65.65 75.95.65.65.35 95.65.65.35.5 65.65.35.5.15 65.35.5.15.95 35.5.15.95.55 5.15.95.55.75 15.95.55.75.85 95.55.75.85.75 55.75.85.75.15 75.85.75.15.95 85.75.15.95.5 75.15.95.5 15.95.5 95.5 5 26.96.46.6.46 96.46.6.46.16 46.6.46.16.16 6.46.16.16.86 46.16.16.86.56 16.16.86.56.56 16.86.56.56.56 86.56.56.56.16 56.56.56.16.36 56.56.16.36.76 56.16.36.76.96 16.36.76.96.96 36.76.96.96.26 76.96.96.26.26 96.96.26.26.36 96.26.26.36.66 26.26.36.66.36 26.36.66.36.36 36.66.36.36 66.36.36 36.36 36 97.27.97.67.77 27.97.67.77.47 97.67.77.47.7 67.77.47.7.47 77.47.7.47.87 47.7.47.87.37 7.47.87.37.87 47.87.37.87.77 87.37.87.77.7 37.87.77.7.57 87.77.7.57.47 77.7.57.47.47 7.57.47.47.37 57.47.47.37.27 47.47.37.27.17 47.37.27.17.7 37.27.17.7 27.17.7 17.7 7 38.68.78.8.28 68.78.8.28.98 78.8.28.98.78 8.28.98.78.58 28.98.78.58.98 98.78.58.98.8 78.58.98.8.88 58.98.8.88.8 98.8.88.8.58 8.88.8.58.58 88.8.58.58.58 8.58.58.58.38 58.58.58.38 58.58.38 58.38 38 99.89.59.39.99 89.59.39.99.29 59.39.99.29.59 39.99.29.59.89 99.29.59.89.89 29.59.89.89.29 59.89.89.29.9 89.89.29.9.79 89.29.9.79.49 29.9.79.49.59 9.79.49.59.29 79.49.59.29.59 49.59.29.59.19 59.29.59.19.39 29.59.19.39.9 59.19.39.9.9 19.39.9.9.99 39.9.9.99.69 9.9.99.69.39 9.99.69.39 99.69.39 69.39 39}
do_execsql_test 1.12.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0.1.1.2.2 1.1.2.2.2 1.2.2.2.3 2.2.2.3.3 2.2.3.3.4 2.3.3.4.5 3.3.4.5.5 3.4.5.5.6 4.5.5.6.7 5.5.6.7.7 5.6.7.7.7 6.7.7.7.8 7.7.7.8.8 7.7.8.8.8 7.8.8.8.9 8.8.8.9.9 8.8.9.9.9 8.9.9.9.10 9.9.9.10.11 9.9.10.11.11 9.10.11.11.12 10.11.11.12.12 11.11.12.12.12 11.12.12.12.13 12.12.12.13.13 12.12.13.13.14 12.13.13.14.15 13.13.14.15.15 13.14.15.15.15 14.15.15.15.16 15.15.15.16.16 15.15.16.16.16 15.16.16.16.17 16.16.16.17.19 16.16.17.19.20 16.17.19.20.21 17.19.20.21.21 19.20.21.21.22 20.21.21.22.22 21.21.22.22.23 21.22.22.23.23 22.22.23.23.23 22.23.23.23.24 23.23.23.24.25 23.23.24.25.26 23.24.25.26.26 24.25.26.26.26 25.26.26.26.27 26.26.26.27.27 26.26.27.27.28 26.27.27.28.29 27.27.28.29.29 27.28.29.29.29 28.29.29.29.30 29.29.29.30.30 29.29.30.30.30 29.30.30.30.31 30.30.30.31.31 30.30.31.31.32 30.31.31.32.33 31.31.32.33.33 31.32.33.33.33 32.33.33.33.33 33.33.33.33.33 33.33.33.33.34 33.33.33.34.34 33.33.34.34.34 33.34.34.34.34 34.34.34.34.35 34.34.34.35.35 34.34.35.35.36 34.35.35.36.36 35.35.36.36.36 35.36.36.36.36 36.36.36.36.37 36.36.36.37.37 36.36.37.37.38 36.37.37.38.38 37.37.38.38.39 37.38.38.39.39 38.38.39.39.39 38.39.39.39.40 39.39.39.40.41 39.39.40.41.41 39.40.41.41.41 40.41.41.41.42 41.41.41.42.43 41.41.42.43.43 41.42.43.43.44 42.43.43.44.44 43.43.44.44.46 43.44.44.46.46 44.44.46.46.47 44.46.46.47.47 46.46.47.47.47 46.47.47.47.47 47.47.47.47.49 47.47.47.49.50 47.47.49.50.51 47.49.50.51.52 49.50.51.52.53 50.51.52.53.54 51.52.53.54.55 52.53.54.55.55 53.54.55.55.56 54.55.55.56.56 55.55.56.56.56 55.56.56.56.57 56.56.56.57.58 56.56.57.58.58 56.57.58.58.58 57.58.58.58.58 58.58.58.58.59 58.58.58.59.59 58.58.59.59.59 58.59.59.59.59 59.59.59.59.60 59.59.59.60.61 59.59.60.61.61 59.60.61.61.62 60.61.61.62.62 61.61.62.62.63 61.62.62.63.64 62.62.63.64.65 62.63.64.65.65 63.64.65.65.65 64.65.65.65.66 65.65.65.66.67 65.65.66.67.68 65.66.67.68.69 66.67.68.69.70 67.68.69.70.72 68.69.70.72.72 69.70.72.72.72 70.72.72.72.73 72.72.72.73.73 72.72.73.73.73 72.73.73.73.74 73.73.73.74.74 73.73.74.74.74 73.74.74.74.74 74.74.74.74.74 74.74.74.74.75 74.74.74.75.75 74.74.75.75.75 74.75.75.75.76 75.75.75.76.77 75.75.76.77.77 75.76.77.77.78 76.77.77.78.78 77.77.78.78.79 77.78.78.79.80 78.78.79.80.80 78.79.80.80.81 79.80.80.81.81 80.80.81.81.81 80.81.81.81.82 81.81.81.82.83 81.81.82.83.84 81.82.83.84.84 82.83.84.84.84 83.84.84.84.84 84.84.84.84.85 84.84.84.85.85 84.84.85.85.85 84.85.85.85.86 85.85.85.86.87 85.85.86.87.87 85.86.87.87.88 86.87.87.88.89 87.87.88.89.89 87.88.89.89.89 88.89.89.89.90 89.89.89.90.90 89.89.90.90.90 89.90.90.90.91 90.90.90.91.91 90.90.91.91.91 90.91.91.91.91 91.91.91.91.91 91.91.91.91.93 91.91.91.93.93 91.91.93.93.93 91.93.93.93.94 93.93.93.94.95 93.93.94.95.95 93.94.95.95.95 94.95.95.95.96 95.95.95.96.96 95.95.96.96.96 95.96.96.96.97 96.96.96.97.97 96.96.97.97.98 96.97.97.98.98 97.97.98.98.99 97.98.98.99.99 98.98.99.99.99 98.99.99.99 99.99.99 99.99 99}
do_execsql_test 1.12.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0.10.20.30.30 10.20.30.30.30 20.30.30.30.40 30.30.30.40.50 30.30.40.50.60 30.40.50.60.70 40.50.60.70.80 50.60.70.80.80 60.70.80.80.90 70.80.80.90.90 80.80.90.90.90 80.90.90.90 90.90.90 90.90 90 1.1.11.11.21 1.11.11.21.21 11.11.21.21.31 11.21.21.31.31 21.21.31.31.41 21.31.31.41.41 31.31.41.41.41 31.41.41.41.51 41.41.41.51.61 41.41.51.61.61 41.51.61.61.81 51.61.61.81.81 61.61.81.81.81 61.81.81.81.91 81.81.81.91.91 81.81.91.91.91 81.91.91.91.91 91.91.91.91.91 91.91.91.91 91.91.91 91.91 91 2.2.2.12.12 2.2.12.12.12 2.12.12.12.22 12.12.12.22.22 12.12.22.22.32 12.22.22.32.42 22.22.32.42.52 22.32.42.52.62 32.42.52.62.62 42.52.62.62.72 52.62.62.72.72 62.62.72.72.72 62.72.72.72.82 72.72.72.82 72.72.82 72.82 82 3.3.13.13.23 3.13.13.23.23 13.13.23.23.23 13.23.23.23.33 23.23.23.33.33 23.23.33.33.33 23.33.33.33.33 33.33.33.33.33 33.33.33.33.43 33.33.33.43.43 33.33.43.43.53 33.43.43.53.63 43.43.53.63.73 43.53.63.73.73 53.63.73.73.73 63.73.73.73.83 73.73.73.83.93 73.73.83.93.93 73.83.93.93.93 83.93.93.93 93.93.93 93.93 93 4.14.24.34.34 14.24.34.34.34 24.34.34.34.34 34.34.34.34.44 34.34.34.44.44 34.34.44.44.54 34.44.44.54.64 44.44.54.64.74 44.54.64.74.74 54.64.74.74.74 64.74.74.74.74 74.74.74.74.74 74.74.74.74.84 74.74.74.84.84 74.74.84.84.84 74.84.84.84.84 84.84.84.84.94 84.84.84.94 84.84.94 84.94 94 5.5.15.15.15 5.15.15.15.25 15.15.15.25.35 15.15.25.35.35 15.25.35.35.55 25.35.35.55.55 35.35.55.55.65 35.55.55.65.65 55.55.65.65.65 55.65.65.65.75 65.65.65.75.75 65.65.75.75.75 65.75.75.75.85 75.75.75.85.85 75.75.85.85.85 75.85.85.85.95 85.85.85.95.95 85.85.95.95.95 85.95.95.95 95.95.95 95.95 95 6.16.16.16.26 16.16.16.26.26 16.16.26.26.26 16.26.26.26.36 26.26.26.36.36 26.26.36.36.36 26.36.36.36.36 36.36.36.36.46 36.36.36.46.46 36.36.46.46.56 36.46.46.56.56 46.46.56.56.56 46.56.56.56.66 56.56.56.66.76 56.56.66.76.86 56.66.76.86.96 66.76.86.96.96 76.86.96.96.96 86.96.96.96 96.96.96 96.96 96 7.7.7.17.27 7.7.17.27.27 7.17.27.27.37 17.27.27.37.37 27.27.37.37.47 27.37.37.47.47 37.37.47.47.47 37.47.47.47.47 47.47.47.47.57 47.47.47.57.67 47.47.57.67.77 47.57.67.77.77 57.67.77.77.87 67.77.77.87.87 77.77.87.87.97 77.87.87.97.97 87.87.97.97 87.97.97 97.97 97 8.8.8.28.38 8.8.28.38.38 8.28.38.38.58 28.38.38.58.58 38.38.58.58.58 38.58.58.58.58 58.58.58.58.68 58.58.58.68.78 58.58.68.78.78 58.68.78.78.88 68.78.78.88.98 78.78.88.98.98 78.88.98.98 88.98.98 98.98 98 9.9.9.19.29 9.9.19.29.29 9.19.29.29.29 19.29.29.29.39 29.29.29.39.39 29.29.39.39.39 29.39.39.39.49 39.39.39.49.59 39.39.49.59.59 39.49.59.59.59 49.59.59.59.59 59.59.59.59.69 59.59.59.69.79 59.59.69.79.89 59.69.79.89.89 69.79.89.89.89 79.89.89.89.99 89.89.89.99.99 89.89.99.99.99 89.99.99.99 99.99.99 99.99 99}
do_execsql_test 1.12.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING ) FROM t2
} {0.90.40.30.80 90.40.30.80.20 40.30.80.20.90 30.80.20.90.60 80.20.90.60.70 20.90.60.70.80 90.60.70.80.90 60.70.80.90.30 70.80.90.30.50 80.90.30.50.10 90.30.50.10.30 30.50.10.30.41 50.10.30.41.81 10.30.41.81.91 30.41.81.91.61 41.81.91.61.91 81.91.61.91.91 91.61.91.91.1 61.91.91.1.81 91.91.1.81.41 91.1.81.41.61 1.81.41.61.1 81.41.61.1.21 41.61.1.21.11 61.1.21.11.51 1.21.11.51.41 21.11.51.41.31 11.51.41.31.31 51.41.31.31.11 41.31.31.11.81 31.31.11.81.91 31.11.81.91.91 11.81.91.91.21 81.91.91.21.2 91.91.21.2.62 91.21.2.62.12 21.2.62.12.32 2.62.12.32.22 62.12.32.22.42 12.32.22.42.2 32.22.42.2.72 22.42.2.72.12 42.2.72.12.22 2.72.12.22.2 72.12.22.2.72 12.22.2.72.72 22.2.72.72.12 2.72.72.12.62 72.72.12.62.52 72.12.62.52.82 12.62.52.82.23 62.52.82.23.33 52.82.23.33.93 82.23.33.93.23 23.33.93.23.93 33.93.23.93.43 93.23.93.43.3 23.93.43.3.43 93.43.3.43.33 43.3.43.33.53 3.43.33.53.63 43.33.53.63.73 33.53.63.73.13 53.63.73.13.73 63.73.13.73.73 73.13.73.73.33 13.73.73.33.93 73.73.33.93.23 73.33.93.23.13 33.93.23.13.33 93.23.13.33.3 23.13.33.3.33 13.33.3.33.83 33.3.33.83.74 3.33.83.74.74 33.83.74.74.54 83.74.74.54.84 74.74.54.84.74 74.54.84.74.24 54.84.74.24.4 84.74.24.4.94 74.24.4.94.84 24.4.94.84.74 4.94.84.74.34 94.84.74.34.34 84.74.34.34.44 74.34.34.44.74 34.34.44.74.64 34.44.74.64.14 44.74.64.14.34 74.64.14.34.84 64.14.34.84.84 14.34.84.84.44 34.84.84.44.34 84.84.44.34.65 84.44.34.65.35 44.34.65.35.85 34.65.35.85.85 65.35.85.85.55 35.85.85.55.15 85.85.55.15.25 85.55.15.25.75 55.15.25.75.95 15.25.75.95.65 25.75.95.65.65 75.95.65.65.35 95.65.65.35.5 65.65.35.5.15 65.35.5.15.95 35.5.15.95.55 5.15.95.55.75 15.95.55.75.85 95.55.75.85.75 55.75.85.75.15 75.85.75.15.95 85.75.15.95.5 75.15.95.5.26 15.95.5.26.96 95.5.26.96.46 5.26.96.46.6 26.96.46.6.46 96.46.6.46.16 46.6.46.16.16 6.46.16.16.86 46.16.16.86.56 16.16.86.56.56 16.86.56.56.56 86.56.56.56.16 56.56.56.16.36 56.56.16.36.76 56.16.36.76.96 16.36.76.96.96 36.76.96.96.26 76.96.96.26.26 96.96.26.26.36 96.26.26.36.66 26.26.36.66.36 26.36.66.36.36 36.66.36.36.97 66.36.36.97.27 36.36.97.27.97 36.97.27.97.67 97.27.97.67.77 27.97.67.77.47 97.67.77.47.7 67.77.47.7.47 77.47.7.47.87 47.7.47.87.37 7.47.87.37.87 47.87.37.87.77 87.37.87.77.7 37.87.77.7.57 87.77.7.57.47 77.7.57.47.47 7.57.47.47.37 57.47.47.37.27 47.47.37.27.17 47.37.27.17.7 37.27.17.7.38 27.17.7.38.68 17.7.38.68.78 7.38.68.78.8 38.68.78.8.28 68.78.8.28.98 78.8.28.98.78 8.28.98.78.58 28.98.78.58.98 98.78.58.98.8 78.58.98.8.88 58.98.8.88.8 98.8.88.8.58 8.88.8.58.58 88.8.58.58.58 8.58.58.58.38 58.58.58.38.99 58.58.38.99.89 58.38.99.89.59 38.99.89.59.39 99.89.59.39.99 89.59.39.99.29 59.39.99.29.59 39.99.29.59.89 99.29.59.89.89 29.59.89.89.29 59.89.89.29.9 89.89.29.9.79 89.29.9.79.49 29.9.79.49.59 9.79.49.59.29 79.49.59.29.59 49.59.29.59.19 59.29.59.19.39 29.59.19.39.9 59.19.39.9.9 19.39.9.9.99 39.9.9.99.69 9.9.99.69.39 9.99.69.39 99.69.39 69.39 39}
do_execsql_test 1.12.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.12.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING)
} {5 74.74 5 74.74.99 5 74.99 5 74.99.33 5 99.33 5 99.33.89 5 33.89 5 33.89.96 5 89.96 5 89.96.38 5 96.38 5 96.38.39 5 38.39 5 38.39.91 5 39.91 5 39.91.6 5 91.6 5 91.6.97 5 6.97 5 6.97.46 5 97.46 5 97.46.54 5 46.54 5 46.54.8 5 54.8 5 54.8.29 5 8.29 5 8.29.84 5 29.84 5 29.84.23 5 84.23 5 84.23.16 5 23.16 5 23.16.65 5 16.65 5 16.65.47 5 65.47 5 65.47.86 5 47.86 5 47.86.61 5 86.61 5 86.61.85 5 61.85 5 61.85.85 5 85.85 5 85.85.59 5 85.59 5 85.59.32 5 59.32 5 59.32.3 5 32.3 5 32.3.22 5 3.22 5 3.22.55 5 22.55 5 22.55.28 5 55.28 5 55.28.25 5 28.25 5 28.25.1 5 25.1 5 25.1.40 5 1.40 5 1.40.56 5 40.56 5 40.56.75 5 56.75 5 56.75.89 5 75.89 5 75.89.76 5 89.76 5 89.76.4 5 76.4 5 76.4.42 5 4.42 5 4.42.78 5 42.78 5 42.78.29 5 78.29 5 78.29.63 5 29.63 5 29.63.87 5 63.87 5 63.87.80 5 87.80 5 87.80.72 5 80.72 5 80.72.9 5 72.9 5 72.9.73 5 9.73 5 9.73.65 5 73.65 5 73.65.58 5 65.58 5 65.58.98 5 58.98 5 58.98.21 5 98.21 5 98.21.65 5 21.65 5 21.65.5 5 65.5 5 65.5.11 5 5.11 5 5.11.87 5 11.87 5 11.87.12 5 87.12 5 87.12.20 5 12.20 5 12.20.31 5 20.31 5 20.31.95 5 31.95 5 31.95.73 5 95.73 5 95.73.88 5 73.88 5 73.88.8 5 88.8 5 88.8.49 5 8.49 5 8.49.90 5 49.90 5 49.90.96 5 90.96 5 90.96.55 5 96.55 5 96.55.77 5 55.77 5 55.77.2 5 77.2 5 77.2.85 5 2.85 5 2.85.74 5 85.74 5 85.74.70 5 74.70 5 74.70.19 5 70.19 5 70.19.26 5 19.26 5 19.26.47 5 26.47 5 26.47.90 5 47.90 5 47.90.58 5 90.58 5 90.58.9 5 58.9 5 58.9.72 5 9.72 5 9.72.33 5 72.33 5 72.33.75 5 33.75 5 33.75.81 5 75.81 5 75.81.23 5 81.23 5 81.23.13 5 23.13 5 23.13.14 5 13.14 5 13.14.91 5 14.91 5 14.91.91 5 91.91 5 91.91.15 5 91.15 5 91.15.36 5 15.36 5 15.36.3 5 36.3 5 36.3.69 5 3.69 5 3.69.52 5 69.52 5 69.52.50 5 52.50 5 52.50.10 5 50.10 5 50.10.33 5 10.33 5 10.33.39 5 33.39 5 33.39.58 5 39.58 5 39.58.38 5 58.38 5 58.38.83 5 38.83 5 38.83.82 5 83.82 5 83.82.7 5 82.7 4 82.7 3 7 2 7 1 {}}
do_execsql_test 1.12.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING)
} {5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {}}
do_execsql_test 1.12.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING)
} {5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {}}
do_execsql_test 1.12.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING)
} {5 89.6.29.47.59 5 6.29.47.59.28 5 29.47.59.28.75 5 47.59.28.75.78 5 59.28.75.78.72 5 28.75.78.72.98 5 75.78.72.98.87 5 78.72.98.87.73 5 72.98.87.73.96 5 98.87.73.96.74 5 87.73.96.74.90 5 73.96.74.90.75 5 96.74.90.75.91 5 74.90.75.91.69 5 90.75.91.69.39 5 75.91.69.39.7 4 91.69.39.7 3 69.39.7 2 39.7 1 7 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 74.96.97.84.86 5 96.97.84.86.32 5 97.84.86.32.25 5 84.86.32.25.89 5 86.32.25.89.29 5 32.25.89.29.9 5 25.89.29.9.21 5 89.29.9.21.12 5 29.9.21.12.88 5 9.21.12.88.55 5 21.12.88.55.70 5 12.88.55.70.58 5 88.55.70.58.81 5 55.70.58.81.91 5 70.58.81.91.52 5 58.81.91.52.58 4 81.91.52.58 3 91.52.58 2 52.58 1 58 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 74.38.46.23.61 5 38.46.23.61.3 5 46.23.61.3.1 5 23.61.3.1.76 5 61.3.1.76.63 5 3.1.76.63.73 5 1.76.63.73.65 5 76.63.73.65.20 5 63.73.65.20.8 5 73.65.20.8.77 5 65.20.8.77.19 5 20.8.77.19.9 5 8.77.19.9.23 5 77.19.9.23.15 5 19.9.23.15.50 5 9.23.15.50.38 4 23.15.50.38 3 15.50.38 2 50.38 1 38 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 99.39.54.16.85 5 39.54.16.85.22 5 54.16.85.22.40 5 16.85.22.40.4 5 85.22.40.4.87 5 22.40.4.87.65 5 40.4.87.65.5 5 4.87.65.5.31 5 87.65.5.31.49 5 65.5.31.49.2 5 5.31.49.2.26 5 31.49.2.26.72 5 49.2.26.72.13 5 2.26.72.13.36 5 26.72.13.36.10 5 72.13.36.10.83 4 13.36.10.83 3 36.10.83 2 10.83 1 83 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {} 5 33.91.8.65.85 5 91.8.65.85.55 5 8.65.85.55.56 5 65.85.55.56.42 5 85.55.56.42.80 5 55.56.42.80.58 5 56.42.80.58.11 5 42.80.58.11.95 5 80.58.11.95.90 5 58.11.95.90.85 5 11.95.90.85.47 5 95.90.85.47.33 5 90.85.47.33.14 5 85.47.33.14.3 5 47.33.14.3.33 5 33.14.3.33.82 4 14.3.33.82 3 3.33.82 2 33.82 1 82 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 5 {} 4 {} 3 {} 2 {} 1 {}}
do_execsql_test 1.13.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {74 99 99 99 33 89 89 96 96 96 68 68 68 91 91 91 99 99 99 97 78 78 97 97 97 67 93 93 93 84 77 23 93 93 93 65 47 86 86 86 91 91 91 85 85 85 59 59 56 56 91 91 91 90 90 55 89 89 89 47 56 56 56 56 56 75 75 89 98 98 98 81 94 94 94 78 78 78 53 63 63 87 87 87 84 84 84 72 61 73 95 95 95 65 96 98 98 98 74 74 74 65 73 73 73 87 87 87 41 20 31 31 31 95 95 95 79 88 88 88 34 49 49 90 90 96 96 96 75 77 77 77 44 85 85 85 74 74 70 70 59 39 39 47 80 90 90 90 58 58 72 72 72 72 93 93 93 81 81 81 37 37 37 14 62 91 91 91 91 91 34 36 99 99 99 95 95 69 58 52 84 84 84 84 84 39 44 58 58 58 38 83 83 83 82 82 17 7 5 {} {}}
do_execsql_test 1.13.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {23 23 23 26 2 2 2 81 59 38 38 38 39 39 46 6 6 6 27 27 27 46 54 8 8 8 29 29 77 23 16 16 16 16 35 35 7 7 7 61 61 61 24 24 24 43 12 12 12 3 3 3 22 22 15 15 15 25 25 1 1 1 40 40 16 16 16 36 36 76 76 4 4 4 30 30 30 29 29 29 2 2 2 37 37 72 41 9 9 9 61 65 13 13 13 58 1 1 1 21 35 5 5 5 11 11 41 12 8 8 8 20 15 15 15 22 22 73 34 8 8 8 11 34 34 59 59 55 55 55 44 2 2 2 7 57 29 29 29 19 19 19 26 26 26 47 36 36 36 9 9 9 66 33 33 33 64 64 9 9 9 13 12 12 12 14 36 36 33 15 15 15 34 3 3 3 58 52 30 30 30 10 10 10 21 21 21 39 30 30 30 34 27 27 17 7 5 5 5 {} {}}
do_execsql_test 1.13.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.13.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.13.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.13.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.13.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.13.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.13.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.13.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.13.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.13.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.13.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.13.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.13.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.13.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.13.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.13.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.13.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.13.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.13.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {28 105 33 41 11 99 92 108 72 52 83 55 79 109 65 26 120 119 50 70 103 80 124 36 96 59 124 116 110 57 51 52 130 103 74 87 48 128 117 105 136 131 71 133 92 109 63 84 109 57 146 78 147 113 74 88 150 87 110 65 121 106 110 124 85 145 107 161 171 150 156 80 171 120 109 158 114 111 136 147 87 173 124 168 173 162 132 101 154 167 190 161 110 156 195 198 102 123 177 169 140 111 180 119 160 197 152 124 121 134 146 147 132 213 141 193 200 210 157 132 136 175 161 218 188 226 191 187 208 211 179 138 144 223 196 214 170 212 202 163 184 172 173 195 229 240 187 210 200 163 227 228 223 191 252 235 225 243 172 187 202 179 179 182 231 261 207 263 206 189 209 212 276 181 274 249 239 234 213 234 269 196 271 221 210 229 235 250 223 232 229 279 224 280 216 207 206 206 206 {} {}}
do_execsql_test 1.13.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {168 134 218 191 212 229 240 213 234 196 223 223 223 {} {} 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 210 210 {} {} 78 120 87 162 124 141 138 227 228 179 231 234 280 280 280 {} {} 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 279 279 {} {} 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 229 229 {} {} 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 206 206 {} {} 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 212 212 {} {} 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 207 207 {} {} 88 171 158 156 198 121 210 132 210 239 250 232 232 232 {} {} 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229 229 229 {} {}}
do_execsql_test 1.13.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {87 138 57 181 80 111 206 26 48 144 207 36 121 132 101 163 172 196 119 136 63 124 179 110 179 182 74 132 189 51 52 85 216 163 134 123 210 78 141 28 57 187 71 87 33 172 173 50 224 88 59 111 170 109 213 223 146 147 84 41 114 191 206 221 157 161 209 229 74 140 107 187 207 212 124 202 52 232 55 184 229 106 44 132 152 120 92 110 179 235 65 70 87 110 195 200 175 234 160 234 136 80 113 187 109 121 124 196 156 210 239 250 72 109 188 202 191 105 154 79 231 147 225 103 161 169 223 96 83 249 212 162 227 228 167 180 193 76 78 117 177 214 145 208 235 150 110 211 103 158 200 168 229 92 156 243 280 279 116 173 269 271 131 133 223 128 173 197 210 99 150 161 147 218 240 109 136 146 261 263 124 130 252 171 190 213 274 108 195 226 119 124 171 198 105 120 276 276 276 {} {}}
do_execsql_test 1.13.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {213 223 106 234 191 212 168 229 147 218 240 240 240 {} {} 123 210 146 147 44 132 152 160 105 154 92 156 243 109 136 146 261 263 263 263 {} {} 124 179 78 141 84 120 234 79 231 162 227 228 280 280 280 {} {} 28 57 187 41 114 191 206 221 92 110 136 147 167 180 193 279 124 130 252 252 252 {} {} 161 209 229 179 235 80 225 76 78 117 177 214 116 173 269 271 171 171 171 {} {} 189 87 74 140 113 187 103 161 169 145 208 235 131 133 223 190 213 274 274 274 {} {} 33 172 173 107 187 207 212 65 70 109 121 124 223 150 128 108 195 226 226 226 {} {} 50 224 124 202 87 110 195 200 196 96 110 211 173 197 119 124 124 124 {} {} 52 232 156 210 239 250 83 103 158 210 171 198 198 198 {} {} 59 111 170 55 184 229 175 72 109 188 202 249 200 99 150 161 105 120 276 276 276 {} {}}
do_execsql_test 1.13.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {168 134 218 191 212 229 240 213 234 196 223 44 92 109 105 136 146 65 156 132 154 102 123 119 160 152 146 147 136 243 261 263 210 11 79 63 84 78 120 87 162 124 141 138 227 228 179 231 234 280 28 41 124 57 130 92 57 110 114 136 147 167 110 180 193 191 252 187 179 206 181 221 279 76 78 80 116 117 71 80 171 173 177 157 161 179 214 225 182 209 269 271 235 229 103 74 131 133 113 74 87 145 190 161 169 140 111 132 213 187 208 223 235 189 274 206 33 108 65 26 70 51 52 128 109 121 124 85 107 150 195 226 172 173 187 223 207 212 119 50 124 96 110 87 48 110 173 124 197 211 144 196 195 200 202 224 216 207 52 83 103 36 88 171 158 156 198 121 210 132 210 239 250 232 105 99 72 55 120 59 109 150 161 111 101 200 175 188 170 202 163 184 163 172 276 249 229 229 229 {} {}}
do_execsql_test 1.13.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {41 {} {} {} {} {} {} {} 59 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 43 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 84 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 65 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {40 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 51 {} {} {} {} {} {} {} {} {} {} {} 22 {} {} {} {} {} 2 {} {} {} 62 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 2 3 4 5 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {20 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 11 21 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 12 12 22 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {40 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 51 {} {} {} {} {} {} {} {} {} {} {} 22 {} {} {} {} {} 2 {} {} {} 62 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5 {} {}}
do_execsql_test 1.13.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {40 30 80 20 90 60 70 80 90 30 50 10 30 {} {} 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 {} {} 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 {} {} 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 {} {} 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 {} {} 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 {} {} 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 {} {} 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 {} {} 78 8 28 98 78 58 98 8 88 8 58 58 58 38 {} {} 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39 {} {}}
do_execsql_test 1.13.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99 {} {}}
do_execsql_test 1.13.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {20 30 30 30 40 50 60 70 80 80 90 90 90 {} {} 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 {} {} 2 12 12 12 22 22 32 42 52 62 62 72 72 72 82 {} {} 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 {} {} 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 {} {} 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 {} {} 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 {} {} 7 17 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 {} {} 8 28 38 38 58 58 58 58 68 78 78 88 98 98 {} {} 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99 {} {}}
do_execsql_test 1.13.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39 {} {}}
do_execsql_test 1.13.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.13.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.13.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.13.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.13.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {41.74.23 74.23.99 23.99.26 99.26.33 26.33.2 33.2.89 2.89.81 89.81.96 81.96.59 96.59.38 59.38.68 38.68.39 68.39.62 39.62.91 62.91.46 91.46.6 46.6.99 6.99.97 99.97.27 97.27.46 27.46.78 46.78.54 78.54.97 54.97.8 97.8.67 8.67.29 67.29.93 29.93.84 93.84.77 84.77.23 77.23.16 23.16.16 16.16.93 16.93.65 93.65.35 65.35.47 35.47.7 47.7.86 7.86.74 86.74.61 74.61.91 61.91.85 91.85.24 85.24.85 24.85.43 85.43.59 43.59.12 59.12.32 12.32.56 32.56.3 56.3.91 3.91.22 91.22.90 22.90.55 90.55.15 55.15.28 15.28.89 28.89.25 89.25.47 25.47.1 47.1.56 1.56.40 56.40.43 40.43.56 43.56.16 56.16.75 16.75.36 75.36.89 36.89.98 89.98.76 98.76.81 76.81.4 81.4.94 4.94.42 94.42.30 42.30.78 30.78.33 78.33.29 33.29.53 29.53.63 53.63.2 63.2.87 2.87.37 87.37.80 37.80.84 80.84.72 84.72.41 72.41.9 41.9.61 9.61.73 61.73.95 73.95.65 95.65.13 65.13.58 13.58.96 58.96.98 96.98.1 98.1.21 1.21.74 21.74.65 74.65.35 65.35.5 35.5.73 5.73.11 73.11.51 11.51.87 51.87.41 87.41.12 41.12.8 12.8.20 8.20.31 20.31.31 31.31.15 31.15.95 15.95.22 95.22.73 22.73.79 73.79.88 79.88.34 88.34.8 34.8.11 8.11.49 11.49.34 49.34.90 34.90.59 90.59.96 59.96.60 96.60.55 60.55.75 55.75.77 75.77.44 77.44.2 44.2.7 2.7.85 7.85.57 85.57.74 57.74.29 74.29.70 29.70.59 70.59.19 59.19.39 19.39.26 39.26.26 26.26.47 26.47.80 47.80.90 80.90.36 90.36.58 36.58.47 58.47.9 47.9.72 9.72.72 72.72.66 72.66.33 66.33.93 33.93.75 93.75.64 75.64.81 64.81.9 81.9.23 9.23.37 23.37.13 37.13.12 13.12.14 12.14.62 14.62.91 62.91.36 91.36.91 36.91.33 91.33.15 33.15.34 15.34.36 34.36.99 36.99.3 99.3.95 3.95.69 95.69.58 69.58.52 58.52.30 52.30.50 30.50.84 50.84.10 84.10.84 10.84.33 84.33.21 33.21.39 21.39.44 39.44.58 44.58.30 58.30.38 30.38.34 38.34.83 34.83.27 83.27.82 27.82.17 82.17.7 17.7.5 7.5 5 {} {}}
do_execsql_test 1.13.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {40.30.80 30.80.20 80.20.90 20.90.60 90.60.70 60.70.80 70.80.90 80.90.30 90.30.50 30.50.10 50.10.30 10.30 30 {} {} 91.61.91 61.91.91 91.91.1 91.1.81 1.81.41 81.41.61 41.61.1 61.1.21 1.21.11 21.11.51 11.51.41 51.41.31 41.31.31 31.31.11 31.11.81 11.81.91 81.91.91 91.91.21 91.21 21 {} {} 12.32.22 32.22.42 22.42.2 42.2.72 2.72.12 72.12.22 12.22.2 22.2.72 2.72.72 72.72.12 72.12.62 12.62.52 62.52.82 52.82 82 {} {} 93.23.93 23.93.43 93.43.3 43.3.43 3.43.33 43.33.53 33.53.63 53.63.73 63.73.13 73.13.73 13.73.73 73.73.33 73.33.93 33.93.23 93.23.13 23.13.33 13.33.3 33.3.33 3.33.83 33.83 83 {} {} 54.84.74 84.74.24 74.24.4 24.4.94 4.94.84 94.84.74 84.74.34 74.34.34 34.34.44 34.44.74 44.74.64 74.64.14 64.14.34 14.34.84 34.84.84 84.84.44 84.44.34 44.34 34 {} {} 85.85.55 85.55.15 55.15.25 15.25.75 25.75.95 75.95.65 95.65.65 65.65.35 65.35.5 35.5.15 5.15.95 15.95.55 95.55.75 55.75.85 75.85.75 85.75.15 75.15.95 15.95.5 95.5 5 {} {} 46.6.46 6.46.16 46.16.16 16.16.86 16.86.56 86.56.56 56.56.56 56.56.16 56.16.36 16.36.76 36.76.96 76.96.96 96.96.26 96.26.26 26.26.36 26.36.66 36.66.36 66.36.36 36.36 36 {} {} 97.67.77 67.77.47 77.47.7 47.7.47 7.47.87 47.87.37 87.37.87 37.87.77 87.77.7 77.7.57 7.57.47 57.47.47 47.47.37 47.37.27 37.27.17 27.17.7 17.7 7 {} {} 78.8.28 8.28.98 28.98.78 98.78.58 78.58.98 58.98.8 98.8.88 8.88.8 88.8.58 8.58.58 58.58.58 58.58.38 58.38 38 {} {} 59.39.99 39.99.29 99.29.59 29.59.89 59.89.89 89.89.29 89.29.9 29.9.79 9.79.49 79.49.59 49.59.29 59.29.59 29.59.19 59.19.39 19.39.9 39.9.9 9.9.99 9.99.69 99.69.39 69.39 39 {} {}}
do_execsql_test 1.13.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {1.2.2 2.2.2 2.2.3 2.3.3 3.3.4 3.4.5 4.5.5 5.5.6 5.6.7 6.7.7 7.7.7 7.7.8 7.8.8 8.8.8 8.8.9 8.9.9 9.9.9 9.9.10 9.10.11 10.11.11 11.11.12 11.12.12 12.12.12 12.12.13 12.13.13 13.13.14 13.14.15 14.15.15 15.15.15 15.15.16 15.16.16 16.16.16 16.16.17 16.17.19 17.19.20 19.20.21 20.21.21 21.21.22 21.22.22 22.22.23 22.23.23 23.23.23 23.23.24 23.24.25 24.25.26 25.26.26 26.26.26 26.26.27 26.27.27 27.27.28 27.28.29 28.29.29 29.29.29 29.29.30 29.30.30 30.30.30 30.30.31 30.31.31 31.31.32 31.32.33 32.33.33 33.33.33 33.33.33 33.33.33 33.33.34 33.34.34 34.34.34 34.34.34 34.34.35 34.35.35 35.35.36 35.36.36 36.36.36 36.36.36 36.36.37 36.37.37 37.37.38 37.38.38 38.38.39 38.39.39 39.39.39 39.39.40 39.40.41 40.41.41 41.41.41 41.41.42 41.42.43 42.43.43 43.43.44 43.44.44 44.44.46 44.46.46 46.46.47 46.47.47 47.47.47 47.47.47 47.47.49 47.49.50 49.50.51 50.51.52 51.52.53 52.53.54 53.54.55 54.55.55 55.55.56 55.56.56 56.56.56 56.56.57 56.57.58 57.58.58 58.58.58 58.58.58 58.58.59 58.59.59 59.59.59 59.59.59 59.59.60 59.60.61 60.61.61 61.61.62 61.62.62 62.62.63 62.63.64 63.64.65 64.65.65 65.65.65 65.65.66 65.66.67 66.67.68 67.68.69 68.69.70 69.70.72 70.72.72 72.72.72 72.72.73 72.73.73 73.73.73 73.73.74 73.74.74 74.74.74 74.74.74 74.74.74 74.74.75 74.75.75 75.75.75 75.75.76 75.76.77 76.77.77 77.77.78 77.78.78 78.78.79 78.79.80 79.80.80 80.80.81 80.81.81 81.81.81 81.81.82 81.82.83 82.83.84 83.84.84 84.84.84 84.84.84 84.84.85 84.85.85 85.85.85 85.85.86 85.86.87 86.87.87 87.87.88 87.88.89 88.89.89 89.89.89 89.89.90 89.90.90 90.90.90 90.90.91 90.91.91 91.91.91 91.91.91 91.91.91 91.91.93 91.93.93 93.93.93 93.93.94 93.94.95 94.95.95 95.95.95 95.95.96 95.96.96 96.96.96 96.96.97 96.97.97 97.97.98 97.98.98 98.98.99 98.99.99 99.99.99 99.99 99 {} {}}
do_execsql_test 1.13.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {20.30.30 30.30.30 30.30.40 30.40.50 40.50.60 50.60.70 60.70.80 70.80.80 80.80.90 80.90.90 90.90.90 90.90 90 {} {} 11.11.21 11.21.21 21.21.31 21.31.31 31.31.41 31.41.41 41.41.41 41.41.51 41.51.61 51.61.61 61.61.81 61.81.81 81.81.81 81.81.91 81.91.91 91.91.91 91.91.91 91.91.91 91.91 91 {} {} 2.12.12 12.12.12 12.12.22 12.22.22 22.22.32 22.32.42 32.42.52 42.52.62 52.62.62 62.62.72 62.72.72 72.72.72 72.72.82 72.82 82 {} {} 13.13.23 13.23.23 23.23.23 23.23.33 23.33.33 33.33.33 33.33.33 33.33.33 33.33.43 33.43.43 43.43.53 43.53.63 53.63.73 63.73.73 73.73.73 73.73.83 73.83.93 83.93.93 93.93.93 93.93 93 {} {} 24.34.34 34.34.34 34.34.34 34.34.44 34.44.44 44.44.54 44.54.64 54.64.74 64.74.74 74.74.74 74.74.74 74.74.74 74.74.84 74.84.84 84.84.84 84.84.84 84.84.94 84.94 94 {} {} 15.15.15 15.15.25 15.25.35 25.35.35 35.35.55 35.55.55 55.55.65 55.65.65 65.65.65 65.65.75 65.75.75 75.75.75 75.75.85 75.85.85 85.85.85 85.85.95 85.95.95 95.95.95 95.95 95 {} {} 16.16.26 16.26.26 26.26.26 26.26.36 26.36.36 36.36.36 36.36.36 36.36.46 36.46.46 46.46.56 46.56.56 56.56.56 56.56.66 56.66.76 66.76.86 76.86.96 86.96.96 96.96.96 96.96 96 {} {} 7.17.27 17.27.27 27.27.37 27.37.37 37.37.47 37.47.47 47.47.47 47.47.47 47.47.57 47.57.67 57.67.77 67.77.77 77.77.87 77.87.87 87.87.97 87.97.97 97.97 97 {} {} 8.28.38 28.38.38 38.38.58 38.58.58 58.58.58 58.58.58 58.58.68 58.68.78 68.78.78 78.78.88 78.88.98 88.98.98 98.98 98 {} {} 9.19.29 19.29.29 29.29.29 29.29.39 29.39.39 39.39.39 39.39.49 39.49.59 49.59.59 59.59.59 59.59.59 59.59.69 59.69.79 69.79.89 79.89.89 89.89.89 89.89.99 89.99.99 99.99.99 99.99 99 {} {}}
do_execsql_test 1.13.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING ) FROM t2
} {40.30.80 30.80.20 80.20.90 20.90.60 90.60.70 60.70.80 70.80.90 80.90.30 90.30.50 30.50.10 50.10.30 10.30.41 30.41.81 41.81.91 81.91.61 91.61.91 61.91.91 91.91.1 91.1.81 1.81.41 81.41.61 41.61.1 61.1.21 1.21.11 21.11.51 11.51.41 51.41.31 41.31.31 31.31.11 31.11.81 11.81.91 81.91.91 91.91.21 91.21.2 21.2.62 2.62.12 62.12.32 12.32.22 32.22.42 22.42.2 42.2.72 2.72.12 72.12.22 12.22.2 22.2.72 2.72.72 72.72.12 72.12.62 12.62.52 62.52.82 52.82.23 82.23.33 23.33.93 33.93.23 93.23.93 23.93.43 93.43.3 43.3.43 3.43.33 43.33.53 33.53.63 53.63.73 63.73.13 73.13.73 13.73.73 73.73.33 73.33.93 33.93.23 93.23.13 23.13.33 13.33.3 33.3.33 3.33.83 33.83.74 83.74.74 74.74.54 74.54.84 54.84.74 84.74.24 74.24.4 24.4.94 4.94.84 94.84.74 84.74.34 74.34.34 34.34.44 34.44.74 44.74.64 74.64.14 64.14.34 14.34.84 34.84.84 84.84.44 84.44.34 44.34.65 34.65.35 65.35.85 35.85.85 85.85.55 85.55.15 55.15.25 15.25.75 25.75.95 75.95.65 95.65.65 65.65.35 65.35.5 35.5.15 5.15.95 15.95.55 95.55.75 55.75.85 75.85.75 85.75.15 75.15.95 15.95.5 95.5.26 5.26.96 26.96.46 96.46.6 46.6.46 6.46.16 46.16.16 16.16.86 16.86.56 86.56.56 56.56.56 56.56.16 56.16.36 16.36.76 36.76.96 76.96.96 96.96.26 96.26.26 26.26.36 26.36.66 36.66.36 66.36.36 36.36.97 36.97.27 97.27.97 27.97.67 97.67.77 67.77.47 77.47.7 47.7.47 7.47.87 47.87.37 87.37.87 37.87.77 87.77.7 77.7.57 7.57.47 57.47.47 47.47.37 47.37.27 37.27.17 27.17.7 17.7.38 7.38.68 38.68.78 68.78.8 78.8.28 8.28.98 28.98.78 98.78.58 78.58.98 58.98.8 98.8.88 8.88.8 88.8.58 8.58.58 58.58.58 58.58.38 58.38.99 38.99.89 99.89.59 89.59.39 59.39.99 39.99.29 99.29.59 29.59.89 59.89.89 89.89.29 89.29.9 29.9.79 9.79.49 79.49.59 49.59.29 59.29.59 29.59.19 59.19.39 19.39.9 39.9.9 9.9.99 9.99.69 99.69.39 69.39 39 {} {}}
do_execsql_test 1.13.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.13.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING)
} {3 74 3 74.99 3 99 3 99.33 3 33 3 33.89 3 89 3 89.96 3 96 3 96.38 3 38 3 38.39 3 39 3 39.91 3 91 3 91.6 3 6 3 6.97 3 97 3 97.46 3 46 3 46.54 3 54 3 54.8 3 8 3 8.29 3 29 3 29.84 3 84 3 84.23 3 23 3 23.16 3 16 3 16.65 3 65 3 65.47 3 47 3 47.86 3 86 3 86.61 3 61 3 61.85 3 85 3 85.85 3 85 3 85.59 3 59 3 59.32 3 32 3 32.3 3 3 3 3.22 3 22 3 22.55 3 55 3 55.28 3 28 3 28.25 3 25 3 25.1 3 1 3 1.40 3 40 3 40.56 3 56 3 56.75 3 75 3 75.89 3 89 3 89.76 3 76 3 76.4 3 4 3 4.42 3 42 3 42.78 3 78 3 78.29 3 29 3 29.63 3 63 3 63.87 3 87 3 87.80 3 80 3 80.72 3 72 3 72.9 3 9 3 9.73 3 73 3 73.65 3 65 3 65.58 3 58 3 58.98 3 98 3 98.21 3 21 3 21.65 3 65 3 65.5 3 5 3 5.11 3 11 3 11.87 3 87 3 87.12 3 12 3 12.20 3 20 3 20.31 3 31 3 31.95 3 95 3 95.73 3 73 3 73.88 3 88 3 88.8 3 8 3 8.49 3 49 3 49.90 3 90 3 90.96 3 96 3 96.55 3 55 3 55.77 3 77 3 77.2 3 2 3 2.85 3 85 3 85.74 3 74 3 74.70 3 70 3 70.19 3 19 3 19.26 3 26 3 26.47 3 47 3 47.90 3 90 3 90.58 3 58 3 58.9 3 9 3 9.72 3 72 3 72.33 3 33 3 33.75 3 75 3 75.81 3 81 3 81.23 3 23 3 23.13 3 13 3 13.14 3 14 3 14.91 3 91 3 91.91 3 91 3 91.15 3 15 3 15.36 3 36 3 36.3 3 3 3 3.69 3 69 3 69.52 3 52 3 52.50 3 50 3 50.10 3 10 3 10.33 3 33 3 33.39 3 39 3 39.58 3 58 3 58.38 3 38 3 38.83 3 83 3 83.82 3 82 3 82.7 3 7 2 7 1 {} 0 {} 0 {}}
do_execsql_test 1.13.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING)
} {3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {}}
do_execsql_test 1.13.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING)
} {3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {}}
do_execsql_test 1.13.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 2 FOLLOWING AND 4 FOLLOWING)
} {3 29.47.59 3 47.59.28 3 59.28.75 3 28.75.78 3 75.78.72 3 78.72.98 3 72.98.87 3 98.87.73 3 87.73.96 3 73.96.74 3 96.74.90 3 74.90.75 3 90.75.91 3 75.91.69 3 91.69.39 3 69.39.7 2 39.7 1 7 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 97.84.86 3 84.86.32 3 86.32.25 3 32.25.89 3 25.89.29 3 89.29.9 3 29.9.21 3 9.21.12 3 21.12.88 3 12.88.55 3 88.55.70 3 55.70.58 3 70.58.81 3 58.81.91 3 81.91.52 3 91.52.58 2 52.58 1 58 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 46.23.61 3 23.61.3 3 61.3.1 3 3.1.76 3 1.76.63 3 76.63.73 3 63.73.65 3 73.65.20 3 65.20.8 3 20.8.77 3 8.77.19 3 77.19.9 3 19.9.23 3 9.23.15 3 23.15.50 3 15.50.38 2 50.38 1 38 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 54.16.85 3 16.85.22 3 85.22.40 3 22.40.4 3 40.4.87 3 4.87.65 3 87.65.5 3 65.5.31 3 5.31.49 3 31.49.2 3 49.2.26 3 2.26.72 3 26.72.13 3 72.13.36 3 13.36.10 3 36.10.83 2 10.83 1 83 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {} 3 8.65.85 3 65.85.55 3 85.55.56 3 55.56.42 3 56.42.80 3 42.80.58 3 80.58.11 3 58.11.95 3 11.95.90 3 95.90.85 3 90.85.47 3 85.47.33 3 47.33.14 3 33.14.3 3 14.3.33 3 3.33.82 2 33.82 1 82 0 {} 0 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 3 {} 2 {} 1 {} 0 {} 0 {}}
do_execsql_test 1.14.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.14.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.14.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.14.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.14.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.14.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.14.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.14.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.14.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.14.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.14.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.14.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.14.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.14.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.14.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.14.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.14.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.14.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.14.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.14.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.14.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206}
do_execsql_test 1.14.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.14.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.14.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.14.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.14.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.14.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 81 86 81 46 98 97 23 41 72 29 13 28 35 16 47 47 9 24 26 98 58 8 24 30 91 58 2 56 29 73 2 42 46 62 62 73 40 16 85 33 37 81 25 9 87 78 87 61 28 59 77 90 74 9 27 41 22 39 67 72 54 85 74 90 7 61 90 62 4 93 72 96 94 29 23 95 74 93 30 23 29 3 1 41 80 65 33 2 98 86 89 25 76 65 40 38 15 13 96 74 97 81 40 16 99 76 96 32 80 86 59 2 99 84 84 39 65 27 76 78 84 16 2 96 59 16 41 28 13 89 22 4 42 91 41 33 87 55 81 29 36 28 6 47 97 97 85 33 41 93 15 85 89 98 98 43 23 73 4 56 29 89 46 65 38 59 68 47 9 93 9 23 39 16 93 98 74 65 75 15 56 93 12 2 81 2 23 97 47 91 15 93 35 16 63 8 53 91 33 99}
do_execsql_test 1.14.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 90 {} {} {} {} {} {} {} 81 {} {} {} 81 21 21 {} {} {} {} 21 {} {} {} 21 12 {} 72 {} {} {} 12 {} 72 {} 12 {} {} 72 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} 73 {} {} {} {} {} 73 {} 23 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} 64 {} {} {} {} {} {} {} {} {} {} 55 {} {} {} {} {} {} 15 55 {} {} {} {} {} 55 {} 15 {} {} {} 16 {} 26 26 {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 47 {} {} {} {} {} 27 47 {} {} {} 98 {} {} {} {} {} 98 {} 98 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 29 {} {} {} {} {} 9 {} 29 29 {} {} {}}
do_execsql_test 1.14.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 4 4 5 5 5 5 6 6 7 7 7 7 7 7 8 8 8 8 8 8 8 9 9 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 17 17 17 17 19 19 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 25 25 25 25 26 26 27 27 28 29 29 29 29 29 29 30 30 30 30 30 30 30 30 30 31 31 31 32 32 33 33 33 33 33 33 33 34 34 34 35 35 35 35 35 35 36 36 36 36 36 36 36 36 36 36 36 37 37 37 38 38 38 38 38 39 39 39 39 39 39 40 40 40 41 41 41 41 42 42 42 43 43 43 43 43 43 43 43 44 44 44 46 46 46 46 47 47 47 47 47 47 47 47 47 47}
do_execsql_test 1.14.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 1 51 51 91 91 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 2 2 62 62 62 {} {} {} {} {} {} {} {} {} {} {} 13 13 43 43 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 25 75 75 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 66 66 66 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 37 37 87 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 58 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 39 39 89 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 74 32 31 84 91 74 3 93 84 74 31 12 90 31 22 74 64 43 64 64 90 74 22 43 90 1 30 62 22 31 31 30 74 64 64 1 40 33 50 11 81 42 40 13 50 81 40 13 13 50 33 52 24 41 81 34 41 34 2 30 2 81 82 53 33 10 33 33 81 34 41 10 81 30 81 4 3 3 23 94 3 61 80 84 94 3 91 91 72 3 63 30 91 94 94 72 91 73 91 84 84 33 41 1 33 84 73 73 91 20 41 84 33 33 84 33 41 84 20 21 44 22 90 22 81 81 74 93 93 93 81 21 83 44 44 21 21 21 13 21 21 34 11 34 73 74 2 60 2 34 2 34 74 60 23 2 2 2 11 91 60 62 73 74 70 51 65 74 93 65 70 34 70 93 93 93 62 35 44 43 12 35 41 43 44 44 41 80 54 72 43 41 43 91 12 80 80 35 33 12}
do_execsql_test 1.14.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.14.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99}
do_execsql_test 1.14.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.14.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9}
do_execsql_test 1.14.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}
do_execsql_test 1.14.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.14.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.14.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.14.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.14.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.14.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.14.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74
do_execsql_test 1.14.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.8
do_execsql_test 1.14.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.
do_execsql_test 1.14.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.9
do_execsql_test 1.14.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90
do_execsql_test 1.14.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.14.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
} {201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.1
do_execsql_test 1.14.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
} {201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {} 201 {}}
do_execsql_test 1.14.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
} {20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {}}
do_execsql_test 1.14.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
} {20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 21 {} 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 {} 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 {
do_execsql_test 1.15.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 95 95 84 84 84 84 84 84 84 84 83 83 83 83 83 83 83 83 83 82}
do_execsql_test 1.15.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.15.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.15.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.15.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.15.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.15.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.15.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.15.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.15.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.15.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.15.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.15.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.15.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.15.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.15.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.15.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.15.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.15.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.15.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.15.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206}
do_execsql_test 1.15.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.15.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.15.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.15.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.15.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.15.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 81 86 81 46 1 67 93 26 95 80 65 56 85 30 12 81 35 89 97 31 31 85 40 96 4 73 84 9 91 73 12 5 56 24 85 49 96 75 53 61 8 8 1 55 34 43 59 80 35 15 78 35 56 70 76 59 51 75 63 26 53 5 89 15 21 5 73 33 29 74 66 12 26 58 4 12 31 35 9 87 73 55 59 53 62 73 23 62 33 90 13 90 9 10 66 5 58 44 38 58 22 33 37 2 73 36 31 72 30 47 73 15 96 70 59 90 {} 7 21 83 {} 47 90 55 36 66 {} 50 {} 84 30 {} {} 34 77 74 {} 58 {} 13 {} 82 93 69 14 62 44 {} {} 30 {} 83 93 {} {} {} 84 {} {} {} {} 14 30 82 34 34 3 {} {} {} {} {} 84 {} {} {} 99 {} {} {} {} {} {} {} 58 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 61 {} {} {} 81 {} 91 {} {} {} {} {} {} {} {} {} 12 {} 72 {} {} {} 22 {} 82 {} 12 {} {} {} {} {} {} {} {} {} {} {} {} 43 {} {} {} {} {} 33 {} {} {} {} {} {} {} 33 {} {} {} {} {} {} {} {} 4 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 15 {} {} {} {} {} {} {} {} {} {} {} {} 16 {} 26 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 {} {} {} {} {} 47 {} {} {} {} {} {} {} {} {} {} 98 {} {} {} {} {} 58 {} 38 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 59 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 1 1 1 2 2 3 4 5 6 7 8 8 8 9 9 10 11 12 12 13 14 15 15 16 16 17 19 21 22 22 23 23 24 25 26 27 29 29 30 30 31 32 33 33 33 34 34 34 35 36 36 36 37 38 38 39 39 40 41 41 43 44 44 46 46 47 47 47 49 50 52 53 55 55 56 56 57 58 58 58 59 59 59 61 62 62 63 65 65 66 68 69 72 72 73 73 74 74 74 75 76 77 78 80 81 81 82 83 84 84 85 85 85 86 87 88 89 89 90 90 91 91 91 93 93 95 95 95 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 1 51 51 91 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 2 2 62 62 72 {} {} {} {} {} {} {} {} {} {} {} 13 13 43 43 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 25 75 75 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 66 66 66 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 37 37 87 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 58 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 39 39 89 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 74 32 31 84 1 14 53 3 84 44 2 93 91 32 52 34 25 33 95 65 61 35 3 74 81 2 91 33 13 23 93 12 5 96 46 82 91 44 2 73 43 84 22 95 82 63 12 75 15 93 35 85 16 33 94 67 83 47 65 43 85 64 95 6 96 33 26 26 65 27 74 74 55 33 25 57 47 7 56 17 37 55 4 58 8 47 15 95 56 17 37 55 6 58 58 26 86 27 56 39 99 77 75 16 58 9 78 58 36 15 46 {} 78 89 9 29 56 {} 26 97 {} 78 16 28 26 36 {} 59 39 99 27 78 {} {} {} 37 27 98 {} 88 8 {} 28 {} {} {} 49 37 29 {} 59 {} {} 47 {} 69 39 59 99 8 78 9 {} {} 58 49 {} {} {} {} 58 {} 38 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 59 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 0 0 0 0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27}
do_execsql_test 1.15.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 0 0 0 0 90 40 30 80 20 90 60 70 80 90 41 41 41 41 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 2 2 2 2 2 62 12 32 22 42 2 72 12 22 2 72 72 23 23 23 23 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 74 74 74 74 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 65 65 65 65 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 26 26 26 26 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 97 97 97 97 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 38 38 38 38 38 68 78 8 28 98 78 58 98 8 88 8 99 99 99 99 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9}
do_execsql_test 1.15.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98}
do_execsql_test 1.15.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 10 20 30 30 30 40 50 60 70 80 1 1 1 1 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 2 2 2 2 2 2 2 12 12 12 22 22 32 42 52 62 62 3 3 3 3 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 4 4 4 4 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 5 5 5 5 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 6 6 6 6 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 7 7 7 7 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 8 8 8 8 8 8 8 28 38 38 58 58 58 58 68 78 9 9 9 9 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89}
do_execsql_test 1.15.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 0 0 0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9}
do_execsql_test 1.15.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.15.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.15.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.15.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.15.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.15.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.15.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 74.23.99.26
do_execsql_test 1.15.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 90.40.30.80.20.90.60.70.80.90.30.50.10.30 40.30.80.20.90.60.70.80.90.30.50.10.30 30.80.20.90.60.70.80.90.30.50.10.30 80.20.90.60.70.80.90.30.50.10.30 20.90.60.70.80.90.30.50.10.30 90.60.70.80.90.30.50.10.30 60.70.80.90.30.50.10.30 70.80.90.30.50.10.30 80.90.30.50.10.30 90.30.50.10.30 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.61.1.21.11.51.41.31.31.11.81.91.91.21 61.1.21.11.51.41.31.31.11.81.91.91.21 1.21.11.51.41.31.31.11.81.91.91.21 21.11.51.41.31.31.11.81.91.91.21 11.51.41.31.31.11.81.91.91.21 51.41.31.31.11.81.91.91.21 41.31.31.11.81.91.91.21 31.31.11.81.91.91.21 31.11.81.91.91.21 11.81.91.91.21 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 32.22.42.2.72.12.22.2.72.72.12.62.52.82 22.42.2.72.12.22.2.72.72.12.62.52.82 42.2.72.12.22.2.72.72.12.62.52.82 2.72.12.22.2.72.72.12.62.52.82 72.12.22.2.72.72.12.62.52.82 12.22.2.72.72.12.62.52.82 22.2.72.72.12.62.52.82 2.72.72.12.62.52.82 72.72.12.62.52.82 72.12.62.52.82 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 53.63.73.13.73.73.33.93.23.13.33.3.33.83 63.73.13.73.73.33.93.23.13.33.3.33.83 73.13.73.73.33.93.23.13.33.3.33.83 13.73.73.33.93.23.13.33.3.33.83 73.73.33.93.23.13.33.3.33.83 73.33.93.23.13.33.3.33.83 33.93.23.13.33.3.33.83 93.23.13.33.3.33.83 23.13.33.3.33.83 13.33.3.33.83 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 94.84.74.34.34.44.74.64.14.34.84.84.44.34 84.74.34.34.44.74.64.14.34.84.84.44.34 74.34.34.44.74.64.14.34.84.84.44.34 34.34.44.74.64.14.34.84.84.44.34 34.44.74.64.14.34.84.84.4
do_execsql_test 1.15.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 2.2.2.3.3.
do_execsql_test 1.15.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 10.20.30.30.30.40.50.60.70.80.80.90.90.90 20.30.30.30.40.50.60.70.80.80.90.90.90 30.30.30.40.50.60.70.80.80.90.90.90 30.30.40.50.60.70.80.80.90.90.90 30.40.50.60.70.80.80.90.90.90 40.50.60.70.80.80.90.90.90 50.60.70.80.80.90.90.90 60.70.80.80.90.90.90 70.80.80.90.90.90 80.80.90.90.90 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 41.41.41.51.61.61.81.81.81.91.91.91.91.91 41.41.51.61.61.81.81.81.91.91.91.91.91 41.51.61.61.81.81.81.91.91.91.91.91 51.61.61.81.81.81.91.91.91.91.91 61.61.81.81.81.91.91.91.91.91 61.81.81.81.91.91.91.91.91 81.81.81.91.91.91.91.91 81.81.91.91.91.91.91 81.91.91.91.91.91 91.91.91.91.91 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 12.12.12.22.22.32.42.52.62.62.72.72.72.82 12.12.22.22.32.42.52.62.62.72.72.72.82 12.22.22.32.42.52.62.62.72.72.72.82 22.22.32.42.52.62.62.72.72.72.82 22.32.42.52.62.62.72.72.72.82 32.42.52.62.62.72.72.72.82 42.52.62.62.72.72.72.82 52.62.62.72.72.72.82 62.62.72.72.72.82 62.72.72.72.82 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.43.43.53.63.73.73.73.83.93.93.93 33.43.43.53.63.73.73.73.83.93.93.93 43.43.53.63.73.73.73.83.93.93.93 43.53.63.73.73.73.83.93.93.93 53.63.73.73.73.83.93.93.93 63.73.73.73.83.93.93.93 73.73.73.83.93.93.93 73.73.83.93.93.93 73.83.93.93.93 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 44.44.54.64.74.74.74.74.74.84.84.84.84.94 44.54.64.74.74.74.74.74.84.84.84.84.94 54.64.74.74.74.74.74.84.84.84.84.94 64.
do_execsql_test 1.15.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING ) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 30.80.20.90
do_execsql_test 1.15.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.15.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING)
} {201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 200 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 199 74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 198 74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 197 99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 196 99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 195 33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 194 33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 193 89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 192 89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 191 96.38.39.91.6.97.46.54.8.29.84.2
do_execsql_test 1.15.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING)
} {201 {} 201 {} 201 {} 201 {} 201 {} 200 {} 199 {} 198 {} 197 {} 196 {} 195 {} 194 {} 193 {} 192 {} 191 {} 190 {} 189 {} 188 {} 187 {} 186 {} 185 {} 184 {} 183 {} 182 {} 181 {} 180 {} 179 {} 178 {} 177 {} 176 {} 175 {} 174 {} 173 {} 172 {} 171 {} 170 {} 169 {} 168 {} 167 {} 166 {} 165 {} 164 {} 163 {} 162 {} 161 {} 160 {} 159 {} 158 {} 157 {} 156 {} 155 {} 154 {} 153 {} 152 {} 151 {} 150 {} 149 {} 148 {} 147 {} 146 {} 145 {} 144 {} 143 {} 142 {} 141 {} 140 {} 139 {} 138 {} 137 {} 136 {} 135 {} 134 {} 133 {} 132 {} 131 {} 130 {} 129 {} 128 {} 127 {} 126 {} 125 {} 124 {} 123 {} 122 {} 121 {} 120 {} 119 {} 118 {} 117 {} 116 {} 115 {} 114 {} 113 {} 112 {} 111 {} 110 {} 109 {} 108 {} 107 {} 106 {} 105 {} 104 {} 103 {} 102 {} 101 {} 100 {} 99 {} 98 {} 97 {} 96 {} 95 {} 94 {} 93 {} 92 {} 91 {} 90 {} 89 {} 88 {} 87 {} 86 {} 85 {} 84 {} 83 {} 82 {} 81 {} 80 {} 79 {} 78 {} 77 {} 76 {} 75 {} 74 {} 73 {} 72 {} 71 {} 70 {} 69 {} 68 {} 67 {} 66 {} 65 {} 64 {} 63 {} 62 {} 61 {} 60 {} 59 {} 58 {} 57 {} 56 {} 55 {} 54 {} 53 {} 52 {} 51 {} 50 {} 49 {} 48 {} 47 {} 46 {} 45 {} 44 {} 43 {} 42 {} 41 {} 40 {} 39 {} 38 {} 37 {} 36 {} 35 {} 34 {} 33 {} 32 {} 31 {} 30 {} 29 {} 28 {} 27 {} 26 {} 25 {} 24 {} 23 {} 22 {} 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {}}
do_execsql_test 1.15.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING)
} {20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 21 {} 21 {} 21 {} 21 {} 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {}}
do_execsql_test 1.15.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 PRECEDING AND UNBOUNDED FOLLOWING)
} {20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 19 6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 18 29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 17 47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 16 59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 15 28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 14 75.78.72.98.87.73.96.74.90.75.91.69.39.7 13 78.72.98.87.73.96.74.90.75.91.69.39.7 12 72.98.87.73.96.74.90.75.91.69.39.7 11 98.87.73.96.74.90.75.91.69.39.7 10 87.73.96.74.90.75.91.69.39.7 9 73.96.74.90.75.91.69.39.7 8 96.74.90.75.91.69.39.7 7 74.90.75.91.69.39.7 6 90.75.91.69.39.7 5 75.91.69.39.7 21 {} 21 {} 21 {} 21 {} 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 19 96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 18 97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 17 84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 16 86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 15 32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 14 25.89.29.9.21.12.88.55.70.58.81.91.52.58 13 89.29.9.21.12.88.55.70.58.81.91.52.58 12 29.9.21.12.88.55.70.58.81.91.52.58 11 9.21.12.88.55.70.58.81.91.52.58 10 21.12.88.55.70.58.81.91.52.58 9 12.88.55.70.58.81.91.52.58 8 88.55.70.58.81.91.52.58 7 55.70.58.81.91.52.58 6 70.58.81.91.52.58 5 58.81.91.52.58 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 19 38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 18 46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 17 23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 16 61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 15 3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 14 1.76.63.73.65.20.8.77.19.9.23.15.50.38 13 76.63.73.65.20.8.77.19.9.23.15.50.38 12 63.73.65.20.8.77.19.9.23.15.50.38 11 73.65.20.8.77.19.9.23.15.50.38 10 65.20.8.77.19.9.23.15.50.38 9 20.8.77.19.9.23.15.50.38 8 8.77.19.9.23.15.50.38 7 77.19.9.23.15.50.38 6 19.9.23.15.50.38 5 9.23.15.50.38 20 {} 20 {} 20 {} 20 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 19 39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 18 54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 17 16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 16 85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 15 22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 14 40.4.87.65.5.31.49.2.26.72.13.36.10.83 13 4.87.65.5.31.49.2.26.72.13.36.10.83 12 87.65.5.31.49.2.26.72.13.36.10.83 11 65.5.31.49.2.26.72.13.36.10.83 10 5.31.49.2.26.72.13.36.10.83 9 31.49.2.26.72.13.36.10.83 8 49.2.26.72.13.36.10.83 7 2.26.72.13.36.10.83 6 26.72.13.36.10.83 5 72.13.36.10.83 20 {} 20 {} 20 {}
do_execsql_test 1.16.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 95 95 84 84 84 84 84 84 84 84 83 83 83 83 83 83 83 83 83 82 82 17 7 5}
do_execsql_test 1.16.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.16.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.16.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.16.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.16.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.16.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.16.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.16.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.16.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.16.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.16.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.16.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.16.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.16.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.16.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.16.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.16.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.16.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.16.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.16.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206}
do_execsql_test 1.16.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 232 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.16.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.16.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {240 240 240 240 240 240 240 240 240 240 240 240 240 240 240 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 198 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276}
do_execsql_test 1.16.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229}
do_execsql_test 1.16.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {1 76 78 33 11 108 52 83 79 65 26 70 103 80 36 116 51 52 128 117 71 63 84 109 78 147 88 121 106 124 85 107 171 150 80 171 120 109 158 87 168 173 162 156 195 198 177 124 121 134 141 210 157 132 161 218 226 191 179 138 214 212 172 173 229 240 187 210 227 228 223 225 179 182 231 207 209 212 239 234 213 234 269 196 271 235 250 223 232 229 280 44 28 105 41 99 92 72 55 109 120 119 50 124 96 59 124 110 57 130 103 74 87 48 105 136 131 133 92 109 57 146 113 74 150 87 110 65 110 145 161 156 114 111 136 147 173 124 132 101 154 167 190 161 110 102 123 169 140 111 180 119 160 197 152 146 147 132 213 193 200 136 175 188 187 208 211 144 223 196 170 202 163 184 195 200 163 191 252 235 243 172 187 202 179 261 263 206 189 276 181 274 249 221 210 229 279 224 216 207 206}
do_execsql_test 1.16.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 41 74 23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5}
do_execsql_test 1.16.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.16.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 1 2 2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99}
do_execsql_test 1.16.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 10 20 30 30 30 40 50 60 70 80 80 90 90 90 1 1 11 11 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 2 2 2 12 12 12 22 22 32 42 52 62 62 72 72 72 82 3 3 13 13 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 4 14 24 34 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 5 5 15 15 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 6 16 16 16 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 7 7 7 17 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 8 8 8 28 38 38 58 58 58 58 68 78 78 88 98 98 9 9 9 19 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99}
do_execsql_test 1.16.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 90 40 30 80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39}
do_execsql_test 1.16.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.16.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.16.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.16.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.16.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.16.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.16.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0.74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 74.41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 41.74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 74.23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.6
do_execsql_test 1.16.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30 90.40.30.80.20.90.60.70.80.90.30.50.10.30 40.30.80.20.90.60.70.80.90.30.50.10.30 30.80.20.90.60.70.80.90.30.50.10.30 80.20.90.60.70.80.90.30.50.10.30 20.90.60.70.80.90.30.50.10.30 90.60.70.80.90.30.50.10.30 60.70.80.90.30.50.10.30 70.80.90.30.50.10.30 80.90.30.50.10.30 90.30.50.10.30 30.50.10.30 50.10.30 10.30 30 41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.61.1.21.11.51.41.31.31.11.81.91.91.21 61.1.21.11.51.41.31.31.11.81.91.91.21 1.21.11.51.41.31.31.11.81.91.91.21 21.11.51.41.31.31.11.81.91.91.21 11.51.41.31.31.11.81.91.91.21 51.41.31.31.11.81.91.91.21 41.31.31.11.81.91.91.21 31.31.11.81.91.91.21 31.11.81.91.91.21 11.81.91.91.21 81.91.91.21 91.91.21 91.21 21 2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 12.32.22.42.2.72.12.22.2.72.72.12.62.52.82 32.22.42.2.72.12.22.2.72.72.12.62.52.82 22.42.2.72.12.22.2.72.72.12.62.52.82 42.2.72.12.22.2.72.72.12.62.52.82 2.72.12.22.2.72.72.12.62.52.82 72.12.22.2.72.72.12.62.52.82 12.22.2.72.72.12.62.52.82 22.2.72.72.12.62.52.82 2.72.72.12.62.52.82 72.72.12.62.52.82 72.12.62.52.82 12.62.52.82 62.52.82 52.82 82 23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 53.63.73.13.73.73.33.93.23.13.33.3.33.83 63.73.13.73.73.33.93.23.13.33.3.33.83 73.13.73.73.33.93.23.13.33.3.33.83 13.73.73.33.93.23.13.33.3.33.83 73.73.33.93.23.13.33.3.33.83 73.33.93.23.13.33.3.33.83 33.93.23.13.33.3.33.83 93.23.13.33.3.33.83 23.13.33.3.33.83 13.33.3.33.83 33.3.33.83 3.33.83 33.83 83 74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 94.84.74.34.34.44.74.64.14.34.84.84.44.34 84.74.34.34.44.74.64.14.34.84.84.44.34 74.34.34.44.74.64.14.34.84.84.44.34 34.34.44.74.64.14.34.84.84.44.34 34.44.74.64.14.34.84.84.44.34 44.74.64.14.34.84.84.44.34 74.64.14.34.84.84.44.34 64.14.34.84.84.44.34 14.34.84.84.44.34 34.84.84.44.34 84.84.44.34 84.44.34 44.34 34 65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 95.65.65.35.5.15.95.55.75.85.75.15.95.5 65.65.35.5.15.95.55.75.85.75.15.95.5 65.35.5.15.95.55.75.85.75.15.95.5 35.5.15.95.55.75.85.75.15.95.5 5.15.95.55.75.85.75.15.95.5 15.95.55.75.85.75.15.95.5 95.55.75.85.75.15.95.5 55.75.85.75.15.95.5 75.85.75.15.95.5 85.75.15.95.5 75.15.95.5 15.95.5 95.5 5 26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36 96.46.6.46.16.16.86.56.56.56.16.36.
do_execsql_test 1.16.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0.1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 1.1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 1.2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 2.2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.
do_execsql_test 1.16.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0.10.20.30.30.30.40.50.60.70.80.80.90.90.90 10.20.30.30.30.40.50.60.70.80.80.90.90.90 20.30.30.30.40.50.60.70.80.80.90.90.90 30.30.30.40.50.60.70.80.80.90.90.90 30.30.40.50.60.70.80.80.90.90.90 30.40.50.60.70.80.80.90.90.90 40.50.60.70.80.80.90.90.90 50.60.70.80.80.90.90.90 60.70.80.80.90.90.90 70.80.80.90.90.90 80.80.90.90.90 80.90.90.90 90.90.90 90.90 90 1.1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 1.11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 11.11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 11.21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 41.41.41.51.61.61.81.81.81.91.91.91.91.91 41.41.51.61.61.81.81.81.91.91.91.91.91 41.51.61.61.81.81.81.91.91.91.91.91 51.61.61.81.81.81.91.91.91.91.91 61.61.81.81.81.91.91.91.91.91 61.81.81.81.91.91.91.91.91 81.81.81.91.91.91.91.91 81.81.91.91.91.91.91 81.91.91.91.91.91 91.91.91.91.91 91.91.91.91 91.91.91 91.91 91 2.2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 2.12.12.12.22.22.32.42.52.62.62.72.72.72.82 12.12.12.22.22.32.42.52.62.62.72.72.72.82 12.12.22.22.32.42.52.62.62.72.72.72.82 12.22.22.32.42.52.62.62.72.72.72.82 22.22.32.42.52.62.62.72.72.72.82 22.32.42.52.62.62.72.72.72.82 32.42.52.62.62.72.72.72.82 42.52.62.62.72.72.72.82 52.62.62.72.72.72.82 62.62.72.72.72.82 62.72.72.72.82 72.72.72.82 72.72.82 72.82 82 3.3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 3.13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 13.13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 13.23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.43.43.53.63.73.73.73.83.93.93.93 33.43.43.53.63.73.73.73.83.93.93.93 43.43.53.63.73.73.73.83.93.93.93 43.53.63.73.73.73.83.93.93.93 53.63.73.73.73.83.93.93.93 63.73.73.73.83.93.93.93 73.73.73.83.93.93.93 73.73.83.93.93.93 73.83.93.93.93 83.93.93.93 93.93.93 93.93 93 4.14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 14.24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 24.34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 44.44.54.64.74.74.74.74.74.84.84.84.84.94 44.54.64.74.74.74.74.74.84.84.84.84.94 54.64.74.74.74.74.74.84.84.84.84.94 64.74.74.74.74.74.84.84.84.84.94 74.74.74.74.74.84.84.84.84.94 74.74.74.74.84.84.84.84.94 74.74.74.84.84.84.84.94 74.74.84.84.84.84.94 74.84.84.84.84.94 84.84.84.84.94 84.84.84.94 84.84.94 84.94 94 5.5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 5.15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 15.15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 15.15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 55.55.65.65.65.75.75.75.85.85.85.95.95.95 55.65.65.65.75.75.75.85.85.85.95.95.95 65.65.65.75.75.75.85.85.85.95.95.95 65.65.75.75.75.85.85.85.95.95.95 65.75.75.75.85.85.85.95.95.95 75.75.75.85.85.85.95.95.95 75.75.85.85.85.95.95.95 75.85.85.85.95.95.95 85.85.85.95.95.95 85.85.95.95.95 85.95.95.95 95.95.95 95.95 95 6.16.16.16.
do_execsql_test 1.16.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) FROM t2
} {0.90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 90.40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 40.30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 30.80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.
do_execsql_test 1.16.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM t2
} {0 74 74 26 2 96 38 68 62 46 6 46 78 54 8 84 16 16 86 74 24 12 32 56 22 90 28 56 40 56 16 36 98 76 4 94 42 30 78 2 80 84 72 58 96 98 74 12 8 20 22 88 34 8 34 90 96 60 44 2 74 70 26 26 80 90 36 58 72 72 66 64 12 14 62 36 34 36 58 52 30 50 84 10 84 44 58 30 38 34 82 41 23 99 33 89 81 59 39 91 99 97 27 97 67 29 93 77 23 93 65 35 47 7 61 91 85 85 43 59 3 91 55 15 89 25 47 1 43 75 89 81 33 29 53 63 87 37 41 9 61 73 95 65 13 1 21 65 35 5 73 11 51 87 41 31 31 15 95 73 79 11 49 59 55 75 77 7 85 57 29 59 19 39 47 47 9 33 93 75 81 9 23 37 13 91 91 33 15 99 3 95 69 33 21 39 83 27 17 7 5}
do_execsql_test 1.16.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
} {201 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 200 74.74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 199 74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 198 74.99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 197 99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 196 99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 195 33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 194 33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 193 89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 192 89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 191 96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 190 96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 189 38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 188 38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 187 39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.6
do_execsql_test 1.16.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
} {201 {} 200 {} 199 {} 198 {} 197 {} 196 {} 195 {} 194 {} 193 {} 192 {} 191 {} 190 {} 189 {} 188 {} 187 {} 186 {} 185 {} 184 {} 183 {} 182 {} 181 {} 180 {} 179 {} 178 {} 177 {} 176 {} 175 {} 174 {} 173 {} 172 {} 171 {} 170 {} 169 {} 168 {} 167 {} 166 {} 165 {} 164 {} 163 {} 162 {} 161 {} 160 {} 159 {} 158 {} 157 {} 156 {} 155 {} 154 {} 153 {} 152 {} 151 {} 150 {} 149 {} 148 {} 147 {} 146 {} 145 {} 144 {} 143 {} 142 {} 141 {} 140 {} 139 {} 138 {} 137 {} 136 {} 135 {} 134 {} 133 {} 132 {} 131 {} 130 {} 129 {} 128 {} 127 {} 126 {} 125 {} 124 {} 123 {} 122 {} 121 {} 120 {} 119 {} 118 {} 117 {} 116 {} 115 {} 114 {} 113 {} 112 {} 111 {} 110 {} 109 {} 108 {} 107 {} 106 {} 105 {} 104 {} 103 {} 102 {} 101 {} 100 {} 99 {} 98 {} 97 {} 96 {} 95 {} 94 {} 93 {} 92 {} 91 {} 90 {} 89 {} 88 {} 87 {} 86 {} 85 {} 84 {} 83 {} 82 {} 81 {} 80 {} 79 {} 78 {} 77 {} 76 {} 75 {} 74 {} 73 {} 72 {} 71 {} 70 {} 69 {} 68 {} 67 {} 66 {} 65 {} 64 {} 63 {} 62 {} 61 {} 60 {} 59 {} 58 {} 57 {} 56 {} 55 {} 54 {} 53 {} 52 {} 51 {} 50 {} 49 {} 48 {} 47 {} 46 {} 45 {} 44 {} 43 {} 42 {} 41 {} 40 {} 39 {} 38 {} 37 {} 36 {} 35 {} 34 {} 33 {} 32 {} 31 {} 30 {} 29 {} 28 {} 27 {} 26 {} 25 {} 24 {} 23 {} 22 {} 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {}}
do_execsql_test 1.16.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
} {20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {}}
do_execsql_test 1.16.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
} {20 89.6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 19 6.29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 18 29.47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 17 47.59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 16 59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 15 28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 14 75.78.72.98.87.73.96.74.90.75.91.69.39.7 13 78.72.98.87.73.96.74.90.75.91.69.39.7 12 72.98.87.73.96.74.90.75.91.69.39.7 11 98.87.73.96.74.90.75.91.69.39.7 10 87.73.96.74.90.75.91.69.39.7 9 73.96.74.90.75.91.69.39.7 8 96.74.90.75.91.69.39.7 7 74.90.75.91.69.39.7 6 90.75.91.69.39.7 5 75.91.69.39.7 4 91.69.39.7 3 69.39.7 2 39.7 1 7 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 74.96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 19 96.97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 18 97.84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 17 84.86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 16 86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 15 32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 14 25.89.29.9.21.12.88.55.70.58.81.91.52.58 13 89.29.9.21.12.88.55.70.58.81.91.52.58 12 29.9.21.12.88.55.70.58.81.91.52.58 11 9.21.12.88.55.70.58.81.91.52.58 10 21.12.88.55.70.58.81.91.52.58 9 12.88.55.70.58.81.91.52.58 8 88.55.70.58.81.91.52.58 7 55.70.58.81.91.52.58 6 70.58.81.91.52.58 5 58.81.91.52.58 4 81.91.52.58 3 91.52.58 2 52.58 1 58 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 74.38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 19 38.46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 18 46.23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 17 23.61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 16 61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 15 3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 14 1.76.63.73.65.20.8.77.19.9.23.15.50.38 13 76.63.73.65.20.8.77.19.9.23.15.50.38 12 63.73.65.20.8.77.19.9.23.15.50.38 11 73.65.20.8.77.19.9.23.15.50.38 10 65.20.8.77.19.9.23.15.50.38 9 20.8.77.19.9.23.15.50.38 8 8.77.19.9.23.15.50.38 7 77.19.9.23.15.50.38 6 19.9.23.15.50.38 5 9.23.15.50.38 4 23.15.50.38 3 15.50.38 2 50.38 1 38 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 99.39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 19 39.54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 18 54.16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 17 16.85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 16 85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 15 22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 14 40.4.87.65.5.31.49.2.26.72.13.36.10.83 13 4.87.65.5.31.49.2.26.72.13.36.10.83 12 87.65.5.31.49.2.26.72.13.36.10.83 11 65.5.31.49.2.26.72.13.36.10.83 10 5.31.49.2.26.72.13.36.10.83 9 31.49.2.26.72.13.36.10.83 8 49.2.26.72.13.36.10.83 7 2.26.72.13.36.10.83 6 26.72.13.36.10.83 5 72.13.36.10.83 4 13.36.10.83 3 36.10.83 2 10.83 1 83 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 20 33.91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 19 91.8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 18 8.65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 17 65.85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 16 85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 15 55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 14 56.42.80.58.11.95.90.85.47.33.14.3.33.82 13 42.80.58.11.95.90.85.47.33.14.3.33.82 12 80.58.11.95.90.85.47.33.14.3.33.82 11 58.11.95.90.85.47.33.14.3.33.82 10 11.95.90.85.47.33.14.3.33.82 9 95.90.85.47.33.14.3.33.82 8 90.85.47.33.14.3.33.82 7 85.47.33.14.3.33.82 6 47.33.14.3.33.82 5 33.14.3.33.82 4 14.3.33.82 3 3.33.82 2 33.82 1 82 20
do_execsql_test 1.17.2.1 {
SELECT max(b) OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 95 95 84 84 84 84 84 84 84 84 83 83 83 83 83 83 83 83 83 82 82 17 7 5 {} {} {} {}}
do_execsql_test 1.17.2.2 {
SELECT min(b) OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 {} {} {} {}}
do_execsql_test 1.17.3.1 {
SELECT row_number() OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.17.3.2 {
SELECT row_number() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.17.3.3 {
SELECT row_number() OVER ( ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.17.4.1 {
SELECT dense_rank() OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.17.4.2 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.17.4.3 {
SELECT dense_rank() OVER ( ORDER BY b ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 3 3 3 4 4 5 6 6 7 8 8 8 9 9 9 10 10 10 11 12 12 13 13 13 14 14 15 16 16 16 17 17 17 18 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 45 45 46 46 46 46 47 48 49 50 51 52 53 53 54 54 54 55 56 56 56 56 57 57 57 57 58 59 59 60 60 61 62 63 63 63 64 65 66 67 68 69 69 69 70 70 70 71 71 71 71 71 72 72 72 73 74 74 75 75 76 77 77 78 78 78 79 80 81 81 81 81 82 82 82 83 84 84 85 86 86 86 87 87 87 88 88 88 88 88 89 89 89 90 91 91 91 92 92 92 93 93 94 94 95 95 95}
do_execsql_test 1.17.4.4 {
SELECT dense_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 5 6 7 8 9 9 10 10 10 1 1 2 2 3 3 4 4 5 5 5 6 7 7 8 8 8 9 9 9 9 9 1 1 1 2 2 2 3 3 4 5 6 7 7 8 8 8 9 1 1 2 2 3 3 3 4 4 4 4 4 5 5 6 7 8 8 8 9 10 10 10 1 2 3 4 4 4 4 5 5 6 7 8 8 8 8 8 9 9 9 9 10 1 1 2 2 2 3 4 4 5 5 6 6 6 7 7 7 8 8 8 9 9 9 1 2 2 2 3 3 3 4 4 4 4 5 5 6 6 6 7 8 9 10 10 10 1 1 1 2 3 3 4 4 5 5 5 5 6 7 8 8 9 9 10 10 1 1 1 2 3 3 4 4 4 4 5 6 6 7 8 8 1 1 1 2 3 3 3 4 4 4 5 6 6 6 6 7 8 9 9 9 10 10 10}
do_execsql_test 1.17.4.5 {
SELECT dense_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10}
do_execsql_test 1.17.4.6 {
SELECT dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}
do_execsql_test 1.17.5.1 {
SELECT rank() OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201}
do_execsql_test 1.17.5.2 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23}
do_execsql_test 1.17.5.3 {
SELECT rank() OVER ( ORDER BY b ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 2 4 4 4 7 7 9 10 10 12 13 13 13 16 16 16 19 19 19 22 23 23 25 25 25 28 28 30 31 31 31 34 34 34 37 38 39 40 40 42 42 44 44 44 47 48 49 49 49 52 52 54 55 55 55 58 58 58 61 61 63 64 64 64 64 64 69 69 69 69 73 73 75 75 75 75 79 79 81 81 83 83 83 86 87 87 87 90 91 91 93 93 95 95 97 97 97 97 101 102 103 104 105 106 107 107 109 109 109 112 113 113 113 113 117 117 117 117 121 122 122 124 124 126 127 128 128 128 131 132 133 134 135 136 136 136 139 139 139 142 142 142 142 142 147 147 147 150 151 151 153 153 155 156 156 158 158 158 161 162 163 163 163 163 167 167 167 170 171 171 173 174 174 174 177 177 177 180 180 180 180 180 185 185 185 188 189 189 189 192 192 192 195 195 197 197 199 199 199}
do_execsql_test 1.17.5.4 {
SELECT rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 2 3 4 4 4 7 8 9 10 11 11 13 13 13 1 1 3 3 5 5 7 7 9 9 9 12 13 13 15 15 15 18 18 18 18 18 1 1 1 4 4 4 7 7 9 10 11 12 12 14 14 14 17 1 1 3 3 5 5 5 8 8 8 8 8 13 13 15 16 17 17 17 20 21 21 21 1 2 3 4 4 4 4 8 8 10 11 12 12 12 12 12 17 17 17 17 21 1 1 3 3 3 6 7 7 9 9 11 11 11 14 14 14 17 17 17 20 20 20 1 2 2 2 5 5 5 8 8 8 8 12 12 14 14 14 17 18 19 20 20 20 1 1 1 4 5 5 7 7 9 9 9 9 13 14 15 15 17 17 19 19 1 1 1 4 5 5 7 7 7 7 11 12 12 14 15 15 1 1 1 4 5 5 5 8 8 8 11 12 12 12 12 16 17 18 18 18 21 21 21}
do_execsql_test 1.17.5.5 {
SELECT rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 143 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 163 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179 179}
do_execsql_test 1.17.5.6 {
SELECT rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88}
do_execsql_test 1.17.6.1 {
SELECT
row_number() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ),
rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ),
dense_rank() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING )
FROM t2
} {1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 16 2 17 16 2 18 16 2 19 16 2 20 16 2 21 16 2 22 16 2 23 16 2 24 16 2 25 16 2 26 16 2 27 16 2 28 16 2 29 16 2 30 16 2 31 16 2 32 16 2 33 33 3 34 33 3 35 33 3 36 33 3 37 33 3 38 33 3 39 33 3 40 33 3 41 33 3 42 33 3 43 33 3 44 33 3 45 33 3 46 33 3 47 33 3 48 33 3 49 33 3 50 33 3 51 33 3 52 33 3 53 33 3 54 54 4 55 54 4 56 54 4 57 54 4 58 54 4 59 54 4 60 54 4 61 54 4 62 54 4 63 54 4 64 54 4 65 54 4 66 54 4 67 54 4 68 54 4 69 54 4 70 54 4 71 54 4 72 54 4 73 54 4 74 54 4 75 54 4 76 76 5 77 76 5 78 76 5 79 76 5 80 76 5 81 76 5 82 76 5 83 76 5 84 76 5 85 76 5 86 76 5 87 76 5 88 76 5 89 76 5 90 76 5 91 76 5 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 23 2 24 23 2 25 23 2 26 23 2 27 23 2 28 23 2 29 23 2 30 23 2 31 23 2 32 23 2 33 23 2 34 23 2 35 23 2 36 23 2 37 23 2 38 23 2 39 23 2 40 23 2 41 23 2 42 23 2 43 23 2 44 23 2 45 23 2 46 46 3 47 46 3 48 46 3 49 46 3 50 46 3 51 46 3 52 46 3 53 46 3 54 46 3 55 46 3 56 46 3 57 46 3 58 46 3 59 46 3 60 46 3 61 46 3 62 46 3 63 46 3 64 46 3 65 46 3 66 46 3 67 46 3 68 68 4 69 68 4 70 68 4 71 68 4 72 68 4 73 68 4 74 68 4 75 68 4 76 68 4 77 68 4 78 68 4 79 68 4 80 68 4 81 68 4 82 68 4 83 68 4 84 68 4 85 68 4 86 68 4 87 68 4 88 88 5 89 88 5 90 88 5 91 88 5 92 88 5 93 88 5 94 88 5 95 88 5 96 88 5 97 88 5 98 88 5 99 88 5 100 88 5 101 88 5 102 88 5 103 88 5 104 88 5 105 88 5 106 88 5 107 88 5 108 88 5 109 88 5 110 88 5}
do_test 1.17.7.1 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0100 0.0150 0.0200 0.0250 0.0300 0.0350 0.0400 0.0450 0.0500 0.0550 0.0600 0.0650 0.0700 0.0750 0.0800 0.0850 0.0900 0.0950 0.1000 0.1050 0.1100 0.1150 0.1200 0.1250 0.1300 0.1350 0.1400 0.1450 0.1500 0.1550 0.1600 0.1650 0.1700 0.1750 0.1800 0.1850 0.1900 0.1950 0.2000 0.2050 0.2100 0.2150 0.2200 0.2250 0.2300 0.2350 0.2400 0.2450 0.2500 0.2550 0.2600 0.2650 0.2700 0.2750 0.2800 0.2850 0.2900 0.2950 0.3000 0.3050 0.3100 0.3150 0.3200 0.3250 0.3300 0.3350 0.3400 0.3450 0.3500 0.3550 0.3600 0.3650 0.3700 0.3750 0.3800 0.3850 0.3900 0.3950 0.4000 0.4050 0.4100 0.4150 0.4200 0.4250 0.4300 0.4350 0.4400 0.4450 0.4500 0.4550 0.4600 0.4650 0.4700 0.4750 0.4800 0.4850 0.4900 0.4950 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5350 0.5400 0.5450 0.5500 0.5550 0.5600 0.5650 0.5700 0.5750 0.5800 0.5850 0.5900 0.5950 0.6000 0.6050 0.6100 0.6150 0.6200 0.6250 0.6300 0.6350 0.6400 0.6450 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6800 0.6850 0.6900 0.6950 0.7000 0.7050 0.7100 0.7150 0.7200 0.7250 0.7300 0.7350 0.7400 0.7450 0.7500 0.7550 0.7600 0.7650 0.7700 0.7750 0.7800 0.7850 0.7900 0.7950 0.8000 0.8050 0.8100 0.8150 0.8200 0.8250 0.8300 0.8350 0.8400 0.8450 0.8500 0.8550 0.8600 0.8650 0.8700 0.8750 0.8800 0.8850 0.8900 0.8950 0.9000 0.9050 0.9100 0.9150 0.9200 0.9250 0.9300 0.9350 0.9400 0.9450 0.9500 0.9550 0.9600 0.9650 0.9700 0.9750 0.9800 0.9850 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.7.2 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2857 0.3571 0.4286 0.5000 0.5714 0.6429 0.7143 0.7857 0.8571 0.9286 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0000 0.0526 0.1053 0.1579 0.2105 0.2632 0.3158 0.3684 0.4211 0.4737 0.5263 0.5789 0.6316 0.6842 0.7368 0.7895 0.8421 0.8947 0.9474 1.0000 0.0000 0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.7.3 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0050 0.0050 0.0150 0.0150 0.0150 0.0300 0.0300 0.0400 0.0450 0.0450 0.0550 0.0600 0.0600 0.0600 0.0750 0.0750 0.0750 0.0900 0.0900 0.0900 0.1050 0.1100 0.1100 0.1200 0.1200 0.1200 0.1350 0.1350 0.1450 0.1500 0.1500 0.1500 0.1650 0.1650 0.1650 0.1800 0.1850 0.1900 0.1950 0.1950 0.2050 0.2050 0.2150 0.2150 0.2150 0.2300 0.2350 0.2400 0.2400 0.2400 0.2550 0.2550 0.2650 0.2700 0.2700 0.2700 0.2850 0.2850 0.2850 0.3000 0.3000 0.3100 0.3150 0.3150 0.3150 0.3150 0.3150 0.3400 0.3400 0.3400 0.3400 0.3600 0.3600 0.3700 0.3700 0.3700 0.3700 0.3900 0.3900 0.4000 0.4000 0.4100 0.4100 0.4100 0.4250 0.4300 0.4300 0.4300 0.4450 0.4500 0.4500 0.4600 0.4600 0.4700 0.4700 0.4800 0.4800 0.4800 0.4800 0.5000 0.5050 0.5100 0.5150 0.5200 0.5250 0.5300 0.5300 0.5400 0.5400 0.5400 0.5550 0.5600 0.5600 0.5600 0.5600 0.5800 0.5800 0.5800 0.5800 0.6000 0.6050 0.6050 0.6150 0.6150 0.6250 0.6300 0.6350 0.6350 0.6350 0.6500 0.6550 0.6600 0.6650 0.6700 0.6750 0.6750 0.6750 0.6900 0.6900 0.6900 0.7050 0.7050 0.7050 0.7050 0.7050 0.7300 0.7300 0.7300 0.7450 0.7500 0.7500 0.7600 0.7600 0.7700 0.7750 0.7750 0.7850 0.7850 0.7850 0.8000 0.8050 0.8100 0.8100 0.8100 0.8100 0.8300 0.8300 0.8300 0.8450 0.8500 0.8500 0.8600 0.8650 0.8650 0.8650 0.8800 0.8800 0.8800 0.8950 0.8950 0.8950 0.8950 0.8950 0.9200 0.9200 0.9200 0.9350 0.9400 0.9400 0.9400 0.9550 0.9550 0.9550 0.9700 0.9700 0.9800 0.9800 0.9900 0.9900 0.9900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.7.4 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0714 0.1429 0.2143 0.2143 0.2143 0.4286 0.5000 0.5714 0.6429 0.7143 0.7143 0.8571 0.8571 0.8571 0.0000 0.0000 0.0952 0.0952 0.1905 0.1905 0.2857 0.2857 0.3810 0.3810 0.3810 0.5238 0.5714 0.5714 0.6667 0.6667 0.6667 0.8095 0.8095 0.8095 0.8095 0.8095 0.0000 0.0000 0.0000 0.1875 0.1875 0.1875 0.3750 0.3750 0.5000 0.5625 0.6250 0.6875 0.6875 0.8125 0.8125 0.8125 1.0000 0.0000 0.0000 0.0909 0.0909 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.3182 0.3182 0.5455 0.5455 0.6364 0.6818 0.7273 0.7273 0.7273 0.8636 0.9091 0.9091 0.9091 0.0000 0.0500 0.1000 0.1500 0.1500 0.1500 0.1500 0.3500 0.3500 0.4500 0.5000 0.5500 0.5500 0.5500 0.5500 0.5500 0.8000 0.8000 0.8000 0.8000 1.0000 0.0000 0.0000 0.0952 0.0952 0.0952 0.2381 0.2857 0.2857 0.3810 0.3810 0.4762 0.4762 0.4762 0.6190 0.6190 0.6190 0.7619 0.7619 0.7619 0.9048 0.9048 0.9048 0.0000 0.0476 0.0476 0.0476 0.1905 0.1905 0.1905 0.3333 0.3333 0.3333 0.3333 0.5238 0.5238 0.6190 0.6190 0.6190 0.7619 0.8095 0.8571 0.9048 0.9048 0.9048 0.0000 0.0000 0.0000 0.1579 0.2105 0.2105 0.3158 0.3158 0.4211 0.4211 0.4211 0.4211 0.6316 0.6842 0.7368 0.7368 0.8421 0.8421 0.9474 0.9474 0.0000 0.0000 0.0000 0.2000 0.2667 0.2667 0.4000 0.4000 0.4000 0.4000 0.6667 0.7333 0.7333 0.8667 0.9333 0.9333 0.0000 0.0000 0.0000 0.1364 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.4545 0.5000 0.5000 0.5000 0.5000 0.6818 0.7273 0.7727 0.7727 0.7727 0.9091 0.9091 0.9091}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.7.5 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER ( ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.0750 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.1850 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.2700 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.3850 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.4900 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.7100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8100 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900 0.8900}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.7.6 {
set myres {}
foreach r [db eval {SELECT percent_rank() OVER (PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.1667 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.3556 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.5889 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.8333 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.2018 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.4128 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.6147 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982 0.7982}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.1 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0100 0.0149 0.0199 0.0249 0.0299 0.0348 0.0398 0.0448 0.0498 0.0547 0.0597 0.0647 0.0697 0.0746 0.0796 0.0846 0.0896 0.0945 0.0995 0.1045 0.1095 0.1144 0.1194 0.1244 0.1294 0.1343 0.1393 0.1443 0.1493 0.1542 0.1592 0.1642 0.1692 0.1741 0.1791 0.1841 0.1891 0.1940 0.1990 0.2040 0.2090 0.2139 0.2189 0.2239 0.2289 0.2338 0.2388 0.2438 0.2488 0.2537 0.2587 0.2637 0.2687 0.2736 0.2786 0.2836 0.2886 0.2935 0.2985 0.3035 0.3085 0.3134 0.3184 0.3234 0.3284 0.3333 0.3383 0.3433 0.3483 0.3532 0.3582 0.3632 0.3682 0.3731 0.3781 0.3831 0.3881 0.3930 0.3980 0.4030 0.4080 0.4129 0.4179 0.4229 0.4279 0.4328 0.4378 0.4428 0.4478 0.4527 0.4577 0.4627 0.4677 0.4726 0.4776 0.4826 0.4876 0.4925 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5323 0.5373 0.5423 0.5473 0.5522 0.5572 0.5622 0.5672 0.5721 0.5771 0.5821 0.5871 0.5920 0.5970 0.6020 0.6070 0.6119 0.6169 0.6219 0.6269 0.6318 0.6368 0.6418 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6766 0.6816 0.6866 0.6915 0.6965 0.7015 0.7065 0.7114 0.7164 0.7214 0.7264 0.7313 0.7363 0.7413 0.7463 0.7512 0.7562 0.7612 0.7662 0.7711 0.7761 0.7811 0.7861 0.7910 0.7960 0.8010 0.8060 0.8109 0.8159 0.8209 0.8259 0.8308 0.8358 0.8408 0.8458 0.8507 0.8557 0.8607 0.8657 0.8706 0.8756 0.8806 0.8856 0.8905 0.8955 0.9005 0.9055 0.9104 0.9154 0.9204 0.9254 0.9303 0.9353 0.9403 0.9453 0.9502 0.9552 0.9602 0.9652 0.9701 0.9751 0.9801 0.9851 0.9900 0.9950 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.2 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.2667 0.3333 0.4000 0.4667 0.5333 0.6000 0.6667 0.7333 0.8000 0.8667 0.9333 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0588 0.1176 0.1765 0.2353 0.2941 0.3529 0.4118 0.4706 0.5294 0.5882 0.6471 0.7059 0.7647 0.8235 0.8824 0.9412 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000 0.0476 0.0952 0.1429 0.1905 0.2381 0.2857 0.3333 0.3810 0.4286 0.4762 0.5238 0.5714 0.6190 0.6667 0.7143 0.7619 0.8095 0.8571 0.9048 0.9524 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0455 0.0909 0.1364 0.1818 0.2273 0.2727 0.3182 0.3636 0.4091 0.4545 0.5000 0.5455 0.5909 0.6364 0.6818 0.7273 0.7727 0.8182 0.8636 0.9091 0.9545 1.0000 0.0500 0.1000 0.1500 0.2000 0.2500 0.3000 0.3500 0.4000 0.4500 0.5000 0.5500 0.6000 0.6500 0.7000 0.7500 0.8000 0.8500 0.9000 0.9500 1.0000 0.0625 0.1250 0.1875 0.2500 0.3125 0.3750 0.4375 0.5000 0.5625 0.6250 0.6875 0.7500 0.8125 0.8750 0.9375 1.0000 0.0435 0.0870 0.1304 0.1739 0.2174 0.2609 0.3043 0.3478 0.3913 0.4348 0.4783 0.5217 0.5652 0.6087 0.6522 0.6957 0.7391 0.7826 0.8261 0.8696 0.9130 0.9565 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.3 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0050 0.0149 0.0149 0.0299 0.0299 0.0299 0.0398 0.0398 0.0448 0.0547 0.0547 0.0597 0.0746 0.0746 0.0746 0.0896 0.0896 0.0896 0.1045 0.1045 0.1045 0.1095 0.1194 0.1194 0.1343 0.1343 0.1343 0.1443 0.1443 0.1493 0.1642 0.1642 0.1642 0.1791 0.1791 0.1791 0.1841 0.1891 0.1940 0.2040 0.2040 0.2139 0.2139 0.2289 0.2289 0.2289 0.2338 0.2388 0.2537 0.2537 0.2537 0.2637 0.2637 0.2687 0.2836 0.2836 0.2836 0.2985 0.2985 0.2985 0.3085 0.3085 0.3134 0.3383 0.3383 0.3383 0.3383 0.3383 0.3582 0.3582 0.3582 0.3582 0.3682 0.3682 0.3881 0.3881 0.3881 0.3881 0.3980 0.3980 0.4080 0.4080 0.4229 0.4229 0.4229 0.4279 0.4428 0.4428 0.4428 0.4478 0.4577 0.4577 0.4677 0.4677 0.4776 0.4776 0.4975 0.4975 0.4975 0.4975 0.5025 0.5075 0.5124 0.5174 0.5224 0.5274 0.5373 0.5373 0.5522 0.5522 0.5522 0.5572 0.5771 0.5771 0.5771 0.5771 0.5970 0.5970 0.5970 0.5970 0.6020 0.6119 0.6119 0.6219 0.6219 0.6269 0.6318 0.6468 0.6468 0.6468 0.6517 0.6567 0.6617 0.6667 0.6716 0.6866 0.6866 0.6866 0.7015 0.7015 0.7015 0.7264 0.7264 0.7264 0.7264 0.7264 0.7413 0.7413 0.7413 0.7463 0.7562 0.7562 0.7662 0.7662 0.7711 0.7811 0.7811 0.7960 0.7960 0.7960 0.8010 0.8060 0.8259 0.8259 0.8259 0.8259 0.8408 0.8408 0.8408 0.8458 0.8557 0.8557 0.8607 0.8756 0.8756 0.8756 0.8905 0.8905 0.8905 0.9154 0.9154 0.9154 0.9154 0.9154 0.9303 0.9303 0.9303 0.9353 0.9502 0.9502 0.9502 0.9652 0.9652 0.9652 0.9751 0.9751 0.9851 0.9851 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.4 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%10 ORDER BY b ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0667 0.1333 0.2000 0.4000 0.4000 0.4000 0.4667 0.5333 0.6000 0.6667 0.8000 0.8000 1.0000 1.0000 1.0000 0.0909 0.0909 0.1818 0.1818 0.2727 0.2727 0.3636 0.3636 0.5000 0.5000 0.5000 0.5455 0.6364 0.6364 0.7727 0.7727 0.7727 1.0000 1.0000 1.0000 1.0000 1.0000 0.1765 0.1765 0.1765 0.3529 0.3529 0.3529 0.4706 0.4706 0.5294 0.5882 0.6471 0.7647 0.7647 0.9412 0.9412 0.9412 1.0000 0.0870 0.0870 0.1739 0.1739 0.3043 0.3043 0.3043 0.5217 0.5217 0.5217 0.5217 0.5217 0.6087 0.6087 0.6522 0.6957 0.8261 0.8261 0.8261 0.8696 1.0000 1.0000 1.0000 0.0476 0.0952 0.1429 0.3333 0.3333 0.3333 0.3333 0.4286 0.4286 0.4762 0.5238 0.7619 0.7619 0.7619 0.7619 0.7619 0.9524 0.9524 0.9524 0.9524 1.0000 0.0909 0.0909 0.2273 0.2273 0.2273 0.2727 0.3636 0.3636 0.4545 0.4545 0.5909 0.5909 0.5909 0.7273 0.7273 0.7273 0.8636 0.8636 0.8636 1.0000 1.0000 1.0000 0.0455 0.1818 0.1818 0.1818 0.3182 0.3182 0.3182 0.5000 0.5000 0.5000 0.5000 0.5909 0.5909 0.7273 0.7273 0.7273 0.7727 0.8182 0.8636 1.0000 1.0000 1.0000 0.1500 0.1500 0.1500 0.2000 0.3000 0.3000 0.4000 0.4000 0.6000 0.6000 0.6000 0.6000 0.6500 0.7000 0.8000 0.8000 0.9000 0.9000 1.0000 1.0000 0.1875 0.1875 0.1875 0.2500 0.3750 0.3750 0.6250 0.6250 0.6250 0.6250 0.6875 0.8125 0.8125 0.8750 1.0000 1.0000 0.1304 0.1304 0.1304 0.1739 0.3043 0.3043 0.3043 0.4348 0.4348 0.4348 0.4783 0.6522 0.6522 0.6522 0.6522 0.6957 0.7391 0.8696 0.8696 0.8696 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.5 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.0746 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.1841 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.2687 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.3831 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.4876 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.5970 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.7065 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8060 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 0.8856 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.6 {
set myres {}
foreach r [db eval {SELECT cume_dist() OVER ( PARTITION BY b%2 ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.1648 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.3516 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.5824 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 0.8242 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.2000 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.4091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.6091 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 0.7909 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.1 {
set myres {}
foreach r [db eval {SELECT ntile(100) OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 100.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.2 {
set myres {}
foreach r [db eval {SELECT ntile(101) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.3 {
set myres {}
foreach r [db eval {SELECT ntile(102) OVER ( ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 98.0000 99.0000 99.0000 100.0000 101.0000 102.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.4 {
set myres {}
foreach r [db eval {SELECT ntile(103) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.5 {
set myres {}
foreach r [db eval {SELECT ntile(104) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.6 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_test 1.17.8.7 {
set myres {}
foreach r [db eval {SELECT ntile(105) OVER ( ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2}] {
lappend myres [format %.4f [set r]]
}
set res2 {1.0000 1.0000 2.0000 2.0000 3.0000 3.0000 4.0000 4.0000 5.0000 5.0000 6.0000 6.0000 7.0000 7.0000 8.0000 8.0000 9.0000 9.0000 10.0000 10.0000 11.0000 11.0000 12.0000 12.0000 13.0000 13.0000 14.0000 14.0000 15.0000 15.0000 16.0000 16.0000 17.0000 17.0000 18.0000 18.0000 19.0000 19.0000 20.0000 20.0000 21.0000 21.0000 22.0000 22.0000 23.0000 23.0000 24.0000 24.0000 25.0000 25.0000 26.0000 26.0000 27.0000 27.0000 28.0000 28.0000 29.0000 29.0000 30.0000 30.0000 31.0000 31.0000 32.0000 32.0000 33.0000 33.0000 34.0000 34.0000 35.0000 35.0000 36.0000 36.0000 37.0000 37.0000 38.0000 38.0000 39.0000 39.0000 40.0000 40.0000 41.0000 41.0000 42.0000 42.0000 43.0000 43.0000 44.0000 44.0000 45.0000 45.0000 46.0000 46.0000 47.0000 47.0000 48.0000 48.0000 49.0000 49.0000 50.0000 50.0000 51.0000 51.0000 52.0000 52.0000 53.0000 53.0000 54.0000 54.0000 55.0000 55.0000 56.0000 56.0000 57.0000 57.0000 58.0000 58.0000 59.0000 59.0000 60.0000 60.0000 61.0000 61.0000 62.0000 62.0000 63.0000 63.0000 64.0000 64.0000 65.0000 65.0000 66.0000 66.0000 67.0000 67.0000 68.0000 68.0000 69.0000 69.0000 70.0000 70.0000 71.0000 71.0000 72.0000 72.0000 73.0000 73.0000 74.0000 74.0000 75.0000 75.0000 76.0000 76.0000 77.0000 77.0000 78.0000 78.0000 79.0000 79.0000 80.0000 80.0000 81.0000 81.0000 82.0000 82.0000 83.0000 83.0000 84.0000 84.0000 85.0000 85.0000 86.0000 86.0000 87.0000 87.0000 88.0000 88.0000 89.0000 89.0000 90.0000 90.0000 91.0000 91.0000 92.0000 92.0000 93.0000 93.0000 94.0000 94.0000 95.0000 95.0000 96.0000 96.0000 97.0000 98.0000 99.0000 100.0000 101.0000 102.0000 103.0000 104.0000 105.0000}
foreach r [set myres] r2 [set res2] {
if {[set r]<([set r2]-0.0001) || [set r]>([set r2]+0.0001)} {
error "list element [set i] does not match: got=[set r] expected=[set r2]"
}
}
set {} {}
} {}
do_execsql_test 1.17.9.1 {
SELECT last_value(a+b) OVER ( ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 {} {} {} {}}
do_execsql_test 1.17.9.2 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {223 223 223 223 223 223 223 223 223 223 223 {} {} {} {} 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 210 {} {} {} {} 280 280 280 280 280 280 280 280 280 280 280 280 280 {} {} {} {} 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 279 {} {} {} {} 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 {} {} {} {} 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 206 {} {} {} {} 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 212 {} {} {} {} 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 {} {} {} {} 232 232 232 232 232 232 232 232 232 232 232 232 {} {} {} {} 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 {} {} {} {}}
do_execsql_test 1.17.9.3 {
SELECT last_value(a+b) OVER ( ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 {} {} {} {}}
do_execsql_test 1.17.9.4 {
SELECT last_value(a+b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {240 240 240 240 240 240 240 240 240 240 240 {} {} {} {} 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 263 {} {} {} {} 280 280 280 280 280 280 280 280 280 280 280 280 280 {} {} {} {} 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 252 {} {} {} {} 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 {} {} {} {} 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 {} {} {} {} 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 226 {} {} {} {} 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 124 {} {} {} {} 198 198 198 198 198 198 198 198 198 198 198 198 {} {} {} {} 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 276 {} {} {} {}}
do_execsql_test 1.17.9.5 {
SELECT last_value(a+b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 {} {} {} {}}
do_execsql_test 1.17.9.6 {
SELECT last_value(a+b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.10.1 {
SELECT nth_value(b,b+1) OVER (ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {23 78 85 29 84 51 93 91 68 74 65 12 4 22 37 15 53 8 16 29 8 34 3 76 73 63 90 47 98 47 90 73 20 89 91 22 77 73 42 41 32 55 79 51 74 44 81 7 65 8 43 80 8 89 90 29 36 15 42 9 9 41 20 16 11 87 20 90 84 80 41 37 34 9 75 63 34 8 8 81 95 31 74 36 41 99 90 91 99 13 2 35 33 36 38 37 20 75 17 {} 5 34 58 33 19 31 50 34 23 5 72 90 11 85 90 36 2 {} 39 27 {} {} 64 2 74 95 37 {} 58 {} 34 44 {} {} 30 70 47 {} 7 {} 15 {} {} 12 33 36 99 17 {} {} 44 {} {} 12 {} {} {} 34 {} {} {} {} 36 44 {} 30 30 10 {} {} {} {} {} 30 {} {} {} 84 {} {} {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.10.2 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {80 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 21 {} {} {} 31 {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} 72 {} {} {} 82 {} {} {} {} {} {} {} {} {} {} {} {} 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 64 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 5 {} {} {} {} {} {} {} {} {} {} {} {} 76 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 27 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.10.3 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {2 3 3 5 5 6 7 7 8 9 9 10 11 12 12 13 13 14 15 15 16 16 19 20 21 22 22 23 23 25 26 26 27 28 29 29 30 31 32 33 33 33 34 34 34 35 36 36 37 37 38 39 39 40 41 41 42 43 44 44 46 47 47 49 50 51 52 53 55 55 56 56 57 58 58 58 59 59 59 60 61 62 63 64 65 65 67 68 69 72 72 73 73 74 74 74 75 75 76 77 78 80 81 81 83 84 84 85 85 86 87 88 89 89 90 90 91 91 91 91 93 93 94 95 95 96 97 98 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.10.4 {
SELECT nth_value(b,b+1) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {30 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 21 31 91 91 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 22 22 32 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 33 33 83 93 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 44 84 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 55 65 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 36 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 57 67 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 78 88 98 {} {} {} {} {} {} {} {} {} {} {} {} {} 59 59 69 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.10.5 {
SELECT nth_value(b,b+1) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {80 84 22 2 34 41 85 23 24 34 25 12 13 11 72 3 85 95 4 75 85 21 65 73 44 31 62 42 4 3 73 13 2 95 56 56 43 2 25 33 83 73 34 72 26 43 13 82 46 16 13 15 65 66 74 14 77 94 57 95 73 65 35 26 16 97 4 97 67 95 98 65 44 5 74 95 68 57 47 26 78 27 5 64 99 8 78 16 16 26 78 27 5 16 99 29 97 96 98 36 79 49 7 46 76 59 {} 58 38 7 5 56 {} 88 59 {} 39 26 {} 56 87 {} 88 76 58 67 77 {} 9 79 49 37 88 {} {} {} 28 98 99 {} 59 39 {} 58 {} {} {} 99 27 39 {} 29 {} {} 8 {} {} {} 69 49 39 88 {} {} {} 38 99 {} {} {} {} 29 {} 89 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.10.6 {
SELECT nth_value(b,b+1) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.11.1 {
SELECT first_value(b) OVER (ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {23 99 26 33 2 89 81 96 59 38 68 39 62 91 46 6 99 97 27 46 78 54 97 8 67 29 93 84 77 23 16 16 93 65 35 47 7 86 74 61 91 85 24 85 43 59 12 32 56 3 91 22 90 55 15 28 89 25 47 1 56 40 43 56 16 75 36 89 98 76 81 4 94 42 30 78 33 29 53 63 2 87 37 80 84 72 41 9 61 73 95 65 13 58 96 98 1 21 74 65 35 5 73 11 51 87 41 12 8 20 31 31 15 95 22 73 79 88 34 8 11 49 34 90 59 96 60 55 75 77 44 2 7 85 57 74 29 70 59 19 39 26 26 47 80 90 36 58 47 9 72 72 66 33 93 75 64 81 9 23 37 13 12 14 62 91 36 91 33 15 34 36 99 3 95 69 58 52 30 50 84 10 84 33 21 39 44 58 30 38 34 83 27 82 17 7 5 {} {} {} {}}
do_execsql_test 1.17.11.2 {
SELECT first_value(b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {80 20 90 60 70 80 90 30 50 10 30 {} {} {} {} 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 {} {} {} {} 22 42 2 72 12 22 2 72 72 12 62 52 82 {} {} {} {} 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 {} {} {} {} 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 {} {} {} {} 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 {} {} {} {} 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 {} {} {} {} 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 {} {} {} {} 28 98 78 58 98 8 88 8 58 58 58 38 {} {} {} {} 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39 {} {} {} {}}
do_execsql_test 1.17.11.3 {
SELECT first_value(b) OVER ( ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {2 2 3 3 4 5 5 6 7 7 7 8 8 8 9 9 9 10 11 11 12 12 12 13 13 14 15 15 15 16 16 16 17 19 20 21 21 22 22 23 23 23 24 25 26 26 26 27 27 28 29 29 29 30 30 30 31 31 32 33 33 33 33 33 34 34 34 34 35 35 36 36 36 36 37 37 38 38 39 39 39 40 41 41 41 42 43 43 44 44 46 46 47 47 47 47 49 50 51 52 53 54 55 55 56 56 56 57 58 58 58 58 59 59 59 59 60 61 61 62 62 63 64 65 65 65 66 67 68 69 70 72 72 72 73 73 73 74 74 74 74 74 75 75 75 76 77 77 78 78 79 80 80 81 81 81 82 83 84 84 84 84 85 85 85 86 87 87 88 89 89 89 90 90 90 91 91 91 91 91 93 93 93 94 95 95 95 96 96 96 97 97 98 98 99 99 99 {} {} {} {}}
do_execsql_test 1.17.11.4 {
SELECT first_value(b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {30 30 40 50 60 70 80 80 90 90 90 {} {} {} {} 21 21 31 31 41 41 41 51 61 61 81 81 81 91 91 91 91 91 {} {} {} {} 12 12 22 22 32 42 52 62 62 72 72 72 82 {} {} {} {} 23 23 23 33 33 33 33 33 43 43 53 63 73 73 73 83 93 93 93 {} {} {} {} 34 34 34 44 44 54 64 74 74 74 74 74 84 84 84 84 94 {} {} {} {} 15 25 35 35 55 55 65 65 65 75 75 75 85 85 85 95 95 95 {} {} {} {} 26 26 26 36 36 36 36 46 46 56 56 56 66 76 86 96 96 96 {} {} {} {} 27 27 37 37 47 47 47 47 57 67 77 77 87 87 97 97 {} {} {} {} 38 38 58 58 58 58 68 78 78 88 98 98 {} {} {} {} 29 29 29 39 39 39 49 59 59 59 59 69 79 89 89 89 99 99 99 {} {} {} {}}
do_execsql_test 1.17.11.5 {
SELECT first_value(b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {80 20 90 60 70 80 90 30 50 10 30 41 81 91 61 91 91 1 81 41 61 1 21 11 51 41 31 31 11 81 91 91 21 2 62 12 32 22 42 2 72 12 22 2 72 72 12 62 52 82 23 33 93 23 93 43 3 43 33 53 63 73 13 73 73 33 93 23 13 33 3 33 83 74 74 54 84 74 24 4 94 84 74 34 34 44 74 64 14 34 84 84 44 34 65 35 85 85 55 15 25 75 95 65 65 35 5 15 95 55 75 85 75 15 95 5 26 96 46 6 46 16 16 86 56 56 56 16 36 76 96 96 26 26 36 66 36 36 97 27 97 67 77 47 7 47 87 37 87 77 7 57 47 47 37 27 17 7 38 68 78 8 28 98 78 58 98 8 88 8 58 58 58 38 99 89 59 39 99 29 59 89 89 29 9 79 49 59 29 59 19 39 9 9 99 69 39 {} {} {} {}}
do_execsql_test 1.17.11.6 {
SELECT first_value(b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.12.1 {
SELECT lead(b,b) OVER (ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {0 4 61 42 8 35 77 7 81 96 9 11 89 32 53 91 30 51 56 54 73 22 59 75 74 78 8 16 65 15 8 31 87 90 12 32 96 74 76 37 85 90 15 35 2 60 36 75 9 51 47 63 51 90 26 42 26 8 76 80 90 37 87 56 79 5 87 8 2 39 73 64 36 90 72 78 36 73 51 33 20 41 2 26 37 33 8 14 33 81 55 1 9 12 39 64 87 72 34 82 21 34 99 62 74 41 69 22 75 27 58 8 79 77 26 26 55 {} 29 30 7 {} 66 55 2 34 64 {} 33 {} 44 84 {} {} 95 85 19 {} 83 {} 91 {} {} 9 50 91 33 34 {} {} 84 {} 7 9 {} {} {} 44 {} {} {} {} 91 84 {} 95 95 52 {} {} {} {} {} 21 {} {} {} 58 {} {} {} {} {} {} {} 83 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.12.2 {
SELECT lead(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 81 {} {} {} 21 {} {} {} {} {} {} {} {} {} {} {} 12 {} 62 {} {} {} 12 {} {} {} 72 {} {} {} {} {} {} {} {} {} {} {} {} 53 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 95 {} {} {} {} {} {} 85 {} {} {} {} {} {} {} {} {} {} {} {} 56 {} 36 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 57 {} {} {} {} {} 7 {} {} {} {} {} {} {} {} {} {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.12.3 {
SELECT lead(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 1 2 2 3 3 5 5 7 7 8 8 9 9 10 11 12 12 13 13 14 15 16 16 17 19 20 21 22 23 23 24 25 26 26 27 28 29 30 31 31 33 33 33 33 34 34 35 36 36 36 37 37 38 39 39 40 41 41 42 43 44 46 47 47 47 47 49 51 52 53 54 55 56 56 57 58 58 58 59 59 59 61 61 62 63 65 65 65 67 69 70 72 72 73 74 74 74 74 75 76 77 78 80 81 81 83 84 84 84 85 85 87 87 88 89 89 90 90 90 91 91 91 93 93 95 95 96 96 97 98 99 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.12.4 {
SELECT lead(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 80 {} {} {} {} {} {} {} {} {} {} {} {} {} 1 11 61 81 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 12 12 72 82 {} {} {} {} {} {} {} {} {} {} {} {} 13 23 63 73 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 34 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 25 35 85 85 95 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 26 76 86 96 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 37 47 47 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 58 58 68 {} {} {} {} {} {} {} {} {} {} {} {} {} 39 49 59 99 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.12.5 {
SELECT lead(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 64 42 81 94 1 44 73 74 44 85 22 33 41 72 93 34 65 54 5 15 81 15 63 84 21 2 62 54 93 43 33 2 75 16 16 23 12 85 62 13 53 94 12 75 23 73 72 26 96 33 55 25 96 74 34 47 84 37 55 53 25 84 75 86 36 54 36 36 55 68 84 84 95 74 65 27 37 87 76 78 57 95 34 99 58 17 96 46 76 78 57 95 86 99 89 36 16 68 96 89 89 47 95 56 59 {} 88 8 97 85 16 {} 78 79 39 59 36 {} 46 77 {} 78 56 98 36 97 {} 59 89 89 47 78 {} {} {} 38 68 58 {} 58 38 {} 98 {} {} {} 19 57 9 {} 9 {} {} 7 {} {} {} 39 89 38 78 39 {} {} 8 19 {} {} {} {} 89 {} 39 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 9 {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.12.6 {
SELECT lead(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.13.1 {
SELECT lag(b,b) OVER (ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} 26 {} {} {} {} {} {} {} {} {} {} 38 {} {} {} {} {} {} {} 6 {} 0 {} {} {} 81 46 6 {} {} 74 {} 23 {} {} {} {} {} 27 {} 99 {} 35 6 {} 12 {} 23 {} 41 61 84 {} 93 39 47 2 54 46 96 56 {} 16 {} {} {} {} 89 {} 16 43 74 85 56 29 99 53 {} 59 33 23 91 59 53 84 99 {} 93 63 47 41 74 98 33 67 35 75 1 23 13 55 27 75 98 35 73 63 2 21 27 13 24 86 23 84 31 20 94 61 65 75 23 36 94 55 90 41 77 96 56 29 40 12 89 63 11 5 73 79 1 16 28 31 73 5 39 53 63 41 11 40 2 13 33 9 29 90 47 72 9 73 30 44 33 74 93 29 74 42 34 63 41 34 96 47 77 1 36 74 72 14 36 26 77 9 72 64 8 91 31 52 30 83}
do_execsql_test 1.17.13.2 {
SELECT lag(b,b) OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 {} 81 {} {} {} {} 1 {} {} {} 41 {} {} {} {} {} {} 22 {} {} {} 12 {} {} 62 {} {} {} {} {} {} {} {} {} 23 {} {} {} {} {} {} {} {} {} {} {} 43 {} 23 {} {} {} {} {} {} {} {} 54 {} {} {} {} {} {} {} {} 74 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 75 {} {} {} {} {} {} 55 {} 75 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 47 {} {} {} {} {} 27 7 {} {} {} {} {} {} {} {} {} 68 {} 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} 89 {} {} {} {} {} {} {} 29 9 {} {} {}}
do_execsql_test 1.17.13.3 {
SELECT lag(b,b) OVER ( ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 0 1 1 1 2 2 2 2 2 2 2 2 3 3 3 4 5 5 5 6 6 6 7 7 7 7 7 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 11 11 11 11 11 12 12 12 12 12 12 13 13 13 14 14 15 15 15 15 15 16 16 16 16 17 19 19 20 20 21 21 22 22 22 22 23 23 23 23 23 23 24 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27 27 27 27 27 28 29 29 29 29 29 30 30 30 30 31 31 31 31 31 32 32 32 32 33 33 33 33 33 33 33 33 33 33 33 33 33 33 34 34 34 34 34 35 35 35 35 36 36 36 36 36 36 36 36 37 37 37 37 37 38 38 38 39 39 39 39 39 39 39 40 41 41 41 41 41 42 43 43 44 43 44 44 44 44 46 46 46 47 47 47 47 47 47 47 49 50}
do_execsql_test 1.17.13.4 {
SELECT lag(b,b) OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 1 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.13.5 {
SELECT lag(b,b) OVER ( ORDER BY b%10,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} 30 {} {} {} {} {} {} {} 91 {} {} {} 61 20 81 {} {} {} 0 1 {} {} {} 41 91 {} 11 70 91 0 22 {} 81 61 12 {} {} 62 {} 0 {} 31 81 {} 91 {} 81 23 61 41 90 90 {} 82 {} {} 21 {} 72 43 32 23 42 {} 30 80 1 {} 60 93 54 {} 90 50 82 23 12 81 11 74 43 90 30 52 53 81 63 41 81 2 34 54 31 30 42 2 3 75 44 91 93 12 31 22 55 41 75 84 1 83 15 74 35 5 22 13 33 3 85 44 23 62 12 5 15 55 33 25 75 12 75 2 74 33 85 36 55 53 75 73 83 47 65 35 5 96 36 27 7 46 84 74 47 36 33 74 15 13 68 94 8 75 15 95 66 54 74 96 97 4 7 16 44 34 37 89 5 36 36 68 96 58 47 29 9 35 56 7}
do_execsql_test 1.17.13.6 {
SELECT lag(b,b) OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {0 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.14.1 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {23.99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 99.26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 26.33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 33.2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 2.89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 89.81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 81.96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28.89.25.47.1.56.40.43.56.16.75.36.89.98.76.81.4.94.42.30.78.33.29.53.63.2.87.37.80.84.72.41.9.61.73.95.65.13.58.96.98.1.21.74.65.35.5.73.11.51.87.41.12.8.20.31.31.15.95.22.73.79.88.34.8.11.49.34.90.59.96.60.55.75.77.44.2.7.85.57.74.29.70.59.19.39.26.26.47.80.90.36.58.47.9.72.72.66.33.93.75.64.81.9.23.37.13.12.14.62.91.36.91.33.15.34.36.99.3.95.69.58.52.30.50.84.10.84.33.21.39.44.58.30.38.34.83.27.82.17.7.5 96.59.38.68.39.62.91.46.6.99.97.27.46.78.54.97.8.67.29.93.84.77.23.16.16.93.65.35.47.7.86.74.61.91.85.24.85.43.59.12.32.56.3.91.22.90.55.15.28
do_execsql_test 1.17.14.2 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%10 ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {80.20.90.60.70.80.90.30.50.10.30 20.90.60.70.80.90.30.50.10.30 90.60.70.80.90.30.50.10.30 60.70.80.90.30.50.10.30 70.80.90.30.50.10.30 80.90.30.50.10.30 90.30.50.10.30 30.50.10.30 50.10.30 10.30 30 {} {} {} {} 91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 81.41.61.1.21.11.51.41.31.31.11.81.91.91.21 41.61.1.21.11.51.41.31.31.11.81.91.91.21 61.1.21.11.51.41.31.31.11.81.91.91.21 1.21.11.51.41.31.31.11.81.91.91.21 21.11.51.41.31.31.11.81.91.91.21 11.51.41.31.31.11.81.91.91.21 51.41.31.31.11.81.91.91.21 41.31.31.11.81.91.91.21 31.31.11.81.91.91.21 31.11.81.91.91.21 11.81.91.91.21 81.91.91.21 91.91.21 91.21 21 {} {} {} {} 22.42.2.72.12.22.2.72.72.12.62.52.82 42.2.72.12.22.2.72.72.12.62.52.82 2.72.12.22.2.72.72.12.62.52.82 72.12.22.2.72.72.12.62.52.82 12.22.2.72.72.12.62.52.82 22.2.72.72.12.62.52.82 2.72.72.12.62.52.82 72.72.12.62.52.82 72.12.62.52.82 12.62.52.82 62.52.82 52.82 82 {} {} {} {} 93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 33.53.63.73.13.73.73.33.93.23.13.33.3.33.83 53.63.73.13.73.73.33.93.23.13.33.3.33.83 63.73.13.73.73.33.93.23.13.33.3.33.83 73.13.73.73.33.93.23.13.33.3.33.83 13.73.73.33.93.23.13.33.3.33.83 73.73.33.93.23.13.33.3.33.83 73.33.93.23.13.33.3.33.83 33.93.23.13.33.3.33.83 93.23.13.33.3.33.83 23.13.33.3.33.83 13.33.3.33.83 33.3.33.83 3.33.83 33.83 83 {} {} {} {} 74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 4.94.84.74.34.34.44.74.64.14.34.84.84.44.34 94.84.74.34.34.44.74.64.14.34.84.84.44.34 84.74.34.34.44.74.64.14.34.84.84.44.34 74.34.34.44.74.64.14.34.84.84.44.34 34.34.44.74.64.14.34.84.84.44.34 34.44.74.64.14.34.84.84.44.34 44.74.64.14.34.84.84.44.34 74.64.14.34.84.84.44.34 64.14.34.84.84.44.34 14.34.84.84.44.34 34.84.84.44.34 84.84.44.34 84.44.34 44.34 34 {} {} {} {} 55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 75.95.65.65.35.5.15.95.55.75.85.75.15.95.5 95.65.65.35.5.15.95.55.75.85.75.15.95.5 65.65.35.5.15.95.55.75.85.75.15.95.5 65.35.5.15.95.55.75.85.75.15.95.5 35.5.15.95.55.75.85.75.15.95.5 5.15.95.55.75.85.75.15.95.5 15.95.55.75.85.75.15.95.5 95.55.75.85.75.15.95.5 55.75.85.75.15.95.5 75.85.75.15.95.5 85.75.15.95.5 75.15.95.5 15.95.5 95.5 5 {} {} {} {} 46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36 16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36 16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36 86.56.56.56.16.36.76.96.96.26.26.36.66.36.36 56.56.56.16.36.76.96.96.26.26.36.66.36.36 56.56.16.36.76.96.96.26.26.36.66.36.36 56.16.36.76.96.96.26.26.36.66.36.36 16.36.76.96.96.26.26.36.66.36.36 36.76.96.96.26.26.36.66.36.36 76.96.96.26.26.36.66.36.36 96.96.26.26.36.66.36.36 96.26.26.36.66.36.36 26.26.36.66.36.36 26.36.66.36.36 36.66.36.36 66.36.36 36.36 36 {} {} {} {} 77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7 47.7.47.87.37.87.77.7.57.47.47.37.27.17.7 7.47.87.37.87.77.7.57.47.47.37.27.17.7 47.87.37.87.77.7.57.47.47.37.27.17.7 87.37.87.77.7.57.47.47.37.27.17.7 37.87.77.7.57.47.47.37.27.17.7 87.77.7.57.47.47.37.27.17.7 77.7.57.47.47.37.27.17.7 7.57.47.47.37.27.17.7 57.47.47.37.27.17.7 47.47.37.27.17.7 47.37.27.17.7 37.27.17.7 27.17.7 17.7 7 {} {} {} {} 28.98.78.58.98.8.88.8.58.58.58.38 98.78.58.98.8.88.8.58.58.58.38 78.58.98.8.88.8.58.58.58.38 58.98.8.88.8.58.58.58.38 98.8.88.8.58.58.58.38 8.88.8.58.58.58.38 88.8.58.58.58.38 8.58.58.58.38 58.58.58.38 58.58.38 58.38 38 {} {} {} {} 99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 29.
do_execsql_test 1.17.14.3 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {2.2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 2.3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 3.3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 3.4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 4.5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 5.5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 5.6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.26.26.26.27.27.28.29.29.29.30.30.30.31.31.32.33.33.33.33.33.34.34.34.34.35.35.36.36.36.36.37.37.38.38.39.39.39.40.41.41.41.42.43.43.44.44.46.46.47.47.47.47.49.50.51.52.53.54.55.55.56.56.56.57.58.58.58.58.59.59.59.59.60.61.61.62.62.63.64.65.65.65.66.67.68.69.70.72.72.72.73.73.73.74.74.74.74.74.75.75.75.76.77.77.78.78.79.80.80.81.81.81.82.83.84.84.84.84.85.85.85.86.87.87.88.89.89.89.90.90.90.91.91.91.91.91.93.93.93.94.95.95.95.96.96.96.97.97.98.98.99.99.99 6.7.7.7.8.8.8.9.9.9.10.11.11.12.12.12.13.13.14.15.15.15.16.16.16.17.19.20.21.21.22.22.23.23.23.24.25.2
do_execsql_test 1.17.14.4 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( PARTITION BY b%10 ORDER BY b,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {30.30.40.50.60.70.80.80.90.90.90 30.40.50.60.70.80.80.90.90.90 40.50.60.70.80.80.90.90.90 50.60.70.80.80.90.90.90 60.70.80.80.90.90.90 70.80.80.90.90.90 80.80.90.90.90 80.90.90.90 90.90.90 90.90 90 {} {} {} {} 21.21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 21.31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 31.31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 31.41.41.41.51.61.61.81.81.81.91.91.91.91.91 41.41.41.51.61.61.81.81.81.91.91.91.91.91 41.41.51.61.61.81.81.81.91.91.91.91.91 41.51.61.61.81.81.81.91.91.91.91.91 51.61.61.81.81.81.91.91.91.91.91 61.61.81.81.81.91.91.91.91.91 61.81.81.81.91.91.91.91.91 81.81.81.91.91.91.91.91 81.81.91.91.91.91.91 81.91.91.91.91.91 91.91.91.91.91 91.91.91.91 91.91.91 91.91 91 {} {} {} {} 12.12.22.22.32.42.52.62.62.72.72.72.82 12.22.22.32.42.52.62.62.72.72.72.82 22.22.32.42.52.62.62.72.72.72.82 22.32.42.52.62.62.72.72.72.82 32.42.52.62.62.72.72.72.82 42.52.62.62.72.72.72.82 52.62.62.72.72.72.82 62.62.72.72.72.82 62.72.72.72.82 72.72.72.82 72.72.82 72.82 82 {} {} {} {} 23.23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 23.33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.33.43.43.53.63.73.73.73.83.93.93.93 33.33.43.43.53.63.73.73.73.83.93.93.93 33.43.43.53.63.73.73.73.83.93.93.93 43.43.53.63.73.73.73.83.93.93.93 43.53.63.73.73.73.83.93.93.93 53.63.73.73.73.83.93.93.93 63.73.73.73.83.93.93.93 73.73.73.83.93.93.93 73.73.83.93.93.93 73.83.93.93.93 83.93.93.93 93.93.93 93.93 93 {} {} {} {} 34.34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 34.44.44.54.64.74.74.74.74.74.84.84.84.84.94 44.44.54.64.74.74.74.74.74.84.84.84.84.94 44.54.64.74.74.74.74.74.84.84.84.84.94 54.64.74.74.74.74.74.84.84.84.84.94 64.74.74.74.74.74.84.84.84.84.94 74.74.74.74.74.84.84.84.84.94 74.74.74.74.84.84.84.84.94 74.74.74.84.84.84.84.94 74.74.84.84.84.84.94 74.84.84.84.84.94 84.84.84.84.94 84.84.84.94 84.84.94 84.94 94 {} {} {} {} 15.25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 25.35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 35.35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 35.55.55.65.65.65.75.75.75.85.85.85.95.95.95 55.55.65.65.65.75.75.75.85.85.85.95.95.95 55.65.65.65.75.75.75.85.85.85.95.95.95 65.65.65.75.75.75.85.85.85.95.95.95 65.65.75.75.75.85.85.85.95.95.95 65.75.75.75.85.85.85.95.95.95 75.75.75.85.85.85.95.95.95 75.75.85.85.85.95.95.95 75.85.85.85.95.95.95 85.85.85.95.95.95 85.85.95.95.95 85.95.95.95 95.95.95 95.95 95 {} {} {} {} 26.26.26.36.36.36.36.46.46.56.56.56.66.76.86.96.96.96 26.26.36.36.36.36.46.46.56.56.56.66.76.86.96.96.96 26.36.36.36.36.46.46.56.56.56.66.76.86.96.96.96 36.36.36.36.46.46.56.56.56.66.76.86.96.96.96 36.36.36.46.46.56.56.56.66.76.86.96.96.96 36.36.46.46.56.56.56.66.76.86.96.96.96 36.46.46.56.56.56.66.76.86.96.96.96 46.46.56.56.56.66.76.86.96.96.96 46.56.56.56.66.76.86.96.96.96 56.56.56.66.76.86.96.96.96 56.56.66.76.86.96.96.96 56.66.76.86.96.96.96 66.76.86.96.96.96 76.86.96.96.96 86.96.96.96 96.96.96 96.96 96 {} {} {} {} 27.27.37.37.47.47.47.47.57.67.77.77.87.87.97.97 27.37.37.47.47.47.47.57.67.77.77.87.87.97.97 37.37.47.47.47.47.57.67.77.77.87.87.97.97 37.47.47.47.47.57.67.77.77.87.87.97.97 47.47.47.47.57.67.77.77.87.87.97.97 47.47.47.57.67.77.77.87.87.97.97 47.47.57.67.77.77.87.87.97.97 47.57.67.77.77.87.87.97.97 57.67.77.77.87.87.97.97 67.77.77.87.87.97.97 77.77.87.87.97.97 77.87.87.97.97 87.87.97.97 87.97.97 97.97 97 {} {} {} {} 38.38.58.58.58.58.68.78.78.88.98.98 38.58.58.58.58.68.78.78.88.98.98 58.58.58.58.68.78.78.88.98.98 58.58.58.68.78.78.88.98.98 58.58.68.78.78.88.98.98 58.68.78.78.88.98.98 68.78.78.88.98.98 78.78.88.98.98 78.88
do_execsql_test 1.17.14.5 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER ( ORDER BY b%10,a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING ) FROM t2
} {80.20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 20.90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 90.60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 60.70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 70.80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 80.90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 90.30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.43.33.53.63.73.13.73.73.33.93.23.13.33.3.33.83.74.74.54.84.74.24.4.94.84.74.34.34.44.74.64.14.34.84.84.44.34.65.35.85.85.55.15.25.75.95.65.65.35.5.15.95.55.75.85.75.15.95.5.26.96.46.6.46.16.16.86.56.56.56.16.36.76.96.96.26.26.36.66.36.36.97.27.97.67.77.47.7.47.87.37.87.77.7.57.47.47.37.27.17.7.38.68.78.8.28.98.78.58.98.8.88.8.58.58.58.38.99.89.59.39.99.29.59.89.89.29.9.79.49.59.29.59.19.39.9.9.99.69.39 30.50.10.30.41.81.91.61.91.91.1.81.41.61.1.21.11.51.41.31.31.11.81.91.91.21.2.62.12.32.22.42.2.72.12.22.2.72.72.12.62.52.82.23.33.93.23.93.43.3.
do_execsql_test 1.17.14.6 {
SELECT group_concat(CAST(b AS TEXT), '.') OVER (PARTITION BY b%2,a ORDER BY b%10 ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING) FROM t2
} {{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}}
do_execsql_test 1.17.15.1 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING)
} {197 99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 196 99.33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 195 33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 194 33.89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 193 89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 192 89.96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 191 96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 190 96.38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 189 38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 188 38.39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 187 39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 186 39.91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 185 91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 184 91.6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26.47.90.58.9.72.33.75.81.23.13.14.91.91.15.36.3.69.52.50.10.33.39.58.38.83.82.7 183 6.97.46.54.8.29.84.23.16.65.47.86.61.85.85.59.32.3.22.55.28.25.1.40.56.75.89.76.4.42.78.29.63.87.80.72.9.73.65.58.98.21.65.5.11.87.12.20.31.95.73.88.8.49.90.96.55.77.2.85.74.70.19.26
do_execsql_test 1.17.15.2 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 0=1) OVER win FROM t2
WINDOW win AS (ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING)
} {197 {} 196 {} 195 {} 194 {} 193 {} 192 {} 191 {} 190 {} 189 {} 188 {} 187 {} 186 {} 185 {} 184 {} 183 {} 182 {} 181 {} 180 {} 179 {} 178 {} 177 {} 176 {} 175 {} 174 {} 173 {} 172 {} 171 {} 170 {} 169 {} 168 {} 167 {} 166 {} 165 {} 164 {} 163 {} 162 {} 161 {} 160 {} 159 {} 158 {} 157 {} 156 {} 155 {} 154 {} 153 {} 152 {} 151 {} 150 {} 149 {} 148 {} 147 {} 146 {} 145 {} 144 {} 143 {} 142 {} 141 {} 140 {} 139 {} 138 {} 137 {} 136 {} 135 {} 134 {} 133 {} 132 {} 131 {} 130 {} 129 {} 128 {} 127 {} 126 {} 125 {} 124 {} 123 {} 122 {} 121 {} 120 {} 119 {} 118 {} 117 {} 116 {} 115 {} 114 {} 113 {} 112 {} 111 {} 110 {} 109 {} 108 {} 107 {} 106 {} 105 {} 104 {} 103 {} 102 {} 101 {} 100 {} 99 {} 98 {} 97 {} 96 {} 95 {} 94 {} 93 {} 92 {} 91 {} 90 {} 89 {} 88 {} 87 {} 86 {} 85 {} 84 {} 83 {} 82 {} 81 {} 80 {} 79 {} 78 {} 77 {} 76 {} 75 {} 74 {} 73 {} 72 {} 71 {} 70 {} 69 {} 68 {} 67 {} 66 {} 65 {} 64 {} 63 {} 62 {} 61 {} 60 {} 59 {} 58 {} 57 {} 56 {} 55 {} 54 {} 53 {} 52 {} 51 {} 50 {} 49 {} 48 {} 47 {} 46 {} 45 {} 44 {} 43 {} 42 {} 41 {} 40 {} 39 {} 38 {} 37 {} 36 {} 35 {} 34 {} 33 {} 32 {} 31 {} 30 {} 29 {} 28 {} 27 {} 26 {} 25 {} 24 {} 23 {} 22 {} 21 {} 20 {} 19 {} 18 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {}}
do_execsql_test 1.17.15.3 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE 1=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING)
} {16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {}}
do_execsql_test 1.17.15.4 {
SELECT count(*) OVER win, group_concat(CAST(b AS TEXT), '.')
FILTER (WHERE a%2=0) OVER win FROM t2
WINDOW win AS (PARTITION BY (a%10) ORDER BY a ROWS BETWEEN 4 FOLLOWING AND UNBOUNDED FOLLOWING)
} {16 59.28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 15 28.75.78.72.98.87.73.96.74.90.75.91.69.39.7 14 75.78.72.98.87.73.96.74.90.75.91.69.39.7 13 78.72.98.87.73.96.74.90.75.91.69.39.7 12 72.98.87.73.96.74.90.75.91.69.39.7 11 98.87.73.96.74.90.75.91.69.39.7 10 87.73.96.74.90.75.91.69.39.7 9 73.96.74.90.75.91.69.39.7 8 96.74.90.75.91.69.39.7 7 74.90.75.91.69.39.7 6 90.75.91.69.39.7 5 75.91.69.39.7 4 91.69.39.7 3 69.39.7 2 39.7 1 7 0 {} 0 {} 0 {} 0 {} 17 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 86.32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 15 32.25.89.29.9.21.12.88.55.70.58.81.91.52.58 14 25.89.29.9.21.12.88.55.70.58.81.91.52.58 13 89.29.9.21.12.88.55.70.58.81.91.52.58 12 29.9.21.12.88.55.70.58.81.91.52.58 11 9.21.12.88.55.70.58.81.91.52.58 10 21.12.88.55.70.58.81.91.52.58 9 12.88.55.70.58.81.91.52.58 8 88.55.70.58.81.91.52.58 7 55.70.58.81.91.52.58 6 70.58.81.91.52.58 5 58.81.91.52.58 4 81.91.52.58 3 91.52.58 2 52.58 1 58 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 61.3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 15 3.1.76.63.73.65.20.8.77.19.9.23.15.50.38 14 1.76.63.73.65.20.8.77.19.9.23.15.50.38 13 76.63.73.65.20.8.77.19.9.23.15.50.38 12 63.73.65.20.8.77.19.9.23.15.50.38 11 73.65.20.8.77.19.9.23.15.50.38 10 65.20.8.77.19.9.23.15.50.38 9 20.8.77.19.9.23.15.50.38 8 8.77.19.9.23.15.50.38 7 77.19.9.23.15.50.38 6 19.9.23.15.50.38 5 9.23.15.50.38 4 23.15.50.38 3 15.50.38 2 50.38 1 38 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 85.22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 15 22.40.4.87.65.5.31.49.2.26.72.13.36.10.83 14 40.4.87.65.5.31.49.2.26.72.13.36.10.83 13 4.87.65.5.31.49.2.26.72.13.36.10.83 12 87.65.5.31.49.2.26.72.13.36.10.83 11 65.5.31.49.2.26.72.13.36.10.83 10 5.31.49.2.26.72.13.36.10.83 9 31.49.2.26.72.13.36.10.83 8 49.2.26.72.13.36.10.83 7 2.26.72.13.36.10.83 6 26.72.13.36.10.83 5 72.13.36.10.83 4 13.36.10.83 3 36.10.83 2 10.83 1 83 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {} 16 85.55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 15 55.56.42.80.58.11.95.90.85.47.33.14.3.33.82 14 56.42.80.58.11.95.90.85.47.33.14.3.33.82 13 42.80.58.11.95.90.85.47.33.14.3.33.82 12 80.58.11.95.90.85.47.33.14.3.33.82 11 58.11.95.90.85.47.33.14.3.33.82 10 11.95.90.85.47.33.14.3.33.82 9 95.90.85.47.33.14.3.33.82 8 90.85.47.33.14.3.33.82 7 85.47.33.14.3.33.82 6 47.33.14.3.33.82 5 33.14.3.33.82 4 14.3.33.82 3 3.33.82 2 33.82 1 82 0 {} 0 {} 0 {} 0 {} 16 {} 15 {} 14 {} 13 {} 12 {} 11 {} 10 {} 9 {} 8 {} 7 {} 6 {} 5 {} 4 {} 3 {} 2 {} 1 {} 0 {} 0 {} 0 {} 0 {}}
finish_test