0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2024-12-12 15:33:44 +00:00
ad hoc ad79ef48a2
libsql wal tests (#1408)
* add tests

* add bench
2024-05-24 13:59:17 +00:00

131 lines
3.6 KiB
Plaintext

CREATE TABLE t1(a INTEGER PRIMARY KEY, b CHAR(1), d FLOAT);
INSERT INTO t1 VALUES
(1, 'A', 5.4),
(2, 'B', 5.55),
(3, 'C', 8.0),
(4, 'D', 10.25),
(5, 'E', 10.26),
(6, 'N', NULL),
(7, 'N', NULL);
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS LAST
RANGE BETWEEN 2.50 PRECEDING AND 2.25 FOLLOWING)
ORDER BY +d DESC NULLS LAST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN 2.50 PRECEDING AND 2.25 FOLLOWING)
ORDER BY +d DESC NULLS FIRST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS LAST
RANGE BETWEEN 2.50 PRECEDING AND UNBOUNDED FOLLOWING)
ORDER BY +d DESC NULLS LAST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN 2.50 PRECEDING AND UNBOUNDED FOLLOWING)
ORDER BY +d DESC NULLS FIRST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS LAST
RANGE BETWEEN 2.50 PRECEDING AND CURRENT ROW)
ORDER BY +d DESC NULLS LAST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN 2.50 PRECEDING AND CURRENT ROW)
ORDER BY +d DESC NULLS FIRST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS LAST
RANGE BETWEEN UNBOUNDED PRECEDING AND 2.25 FOLLOWING)
ORDER BY +d DESC NULLS LAST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN UNBOUNDED PRECEDING AND 2.25 FOLLOWING)
ORDER BY +d DESC NULLS FIRST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS LAST
RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
ORDER BY +d DESC NULLS LAST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
ORDER BY +d DESC NULLS FIRST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS LAST
RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
ORDER BY +d DESC NULLS LAST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
ORDER BY +d DESC NULLS FIRST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS LAST
RANGE BETWEEN CURRENT ROW AND 2.25 FOLLOWING)
ORDER BY +d DESC NULLS LAST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN CURRENT ROW AND 2.25 FOLLOWING)
ORDER BY +d DESC NULLS FIRST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS LAST
RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
ORDER BY +d DESC NULLS LAST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
ORDER BY +d DESC NULLS FIRST, +a;
SELECT a, b, quote(d), group_concat(b,'') OVER w1 FROM t1
WINDOW w1 AS
(ORDER BY d DESC NULLS FIRST
RANGE BETWEEN 2.50 PRECEDING AND 0.5 PRECEDING)
ORDER BY +d DESC NULLS FIRST, +a;