mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-16 12:38:46 +00:00
ad79ef48a2
* add tests * add bench
60 lines
1.1 KiB
Plaintext
60 lines
1.1 KiB
Plaintext
|
|
CREATE TABLE t2(c, d);
|
|
|
|
CREATE TABLE t1(a, b);
|
|
INSERT INTO t1 VALUES(1, 1);
|
|
INSERT INTO t1 VALUES(2, 2);
|
|
INSERT INTO t1 VALUES(1, 3);
|
|
INSERT INTO t1 VALUES(2, 4);
|
|
INSERT INTO t1 VALUES(1, 5);
|
|
INSERT INTO t1 VALUES(2, 6);
|
|
|
|
|
|
SELECT x,y FROM (
|
|
SELECT a AS x, sum(b) AS y FROM t1
|
|
GROUP BY a
|
|
) WHERE x BETWEEN 2 AND 9999
|
|
|
|
|
|
SELECT x,y FROM (
|
|
SELECT a AS x, sum(b) AS y FROM t1
|
|
WHERE x BETWEEN 2 AND 9999
|
|
GROUP BY a
|
|
)
|
|
|
|
|
|
CREATE TABLE t3(a, b);
|
|
INSERT INTO t3 VALUES(1, 1);
|
|
INSERT INTO t3 VALUES(1, 2);
|
|
INSERT INTO t3 VALUES(1, 3);
|
|
INSERT INTO t3 VALUES(2, 1);
|
|
INSERT INTO t3 VALUES(2, 2);
|
|
INSERT INTO t3 VALUES(2, 3);
|
|
|
|
|
|
SELECT a, sum(b) FROM t3 GROUP BY a HAVING nondeter(a)
|
|
|
|
|
|
SELECT a, sum(b) FROM t3 WHERE nondeter(a) GROUP BY a
|
|
|
|
|
|
CREATE TABLE t1(a, b);
|
|
CREATE TABLE t2(x, y);
|
|
INSERT INTO t1 VALUES('a', 'b');
|
|
|
|
|
|
SELECT min(b), (
|
|
SELECT x FROM t2 WHERE a=2 GROUP BY y HAVING 0
|
|
) FROM t1;
|
|
|
|
|
|
SELECT EXISTS (
|
|
SELECT * FROM (
|
|
SELECT * FROM (
|
|
SELECT 1
|
|
) WHERE Col0 = 1 GROUP BY 1
|
|
) WHERE 0
|
|
)
|
|
FROM (SELECT 1 Col0) GROUP BY 1
|
|
|