2 CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT,descr TEXT);
3 -- [sqlgg] name=select_all
5 SELECT name,descr FROM test;
6 INSERT INTO test VALUES;
8 INSERT INTO test (name,descr) VALUES;
9 SELECT * FROM test WHERE name = @name LIMIT @limit;
10 -- [sqlgg] name=select_distinct_limit
12 FROM test ORDER BY id DESC LIMIT ?;
13 -- [sqlgg] name=Delete
14 DELETE FROM test WHERE id = ?;
15 -- [sqlgg] name=Exaggerate
16 UPDATE test SET descr = @extra || ' ' || descr;
18 CREATE TABLE loc (id INTEGER PRIMARY KEY AUTOINCREMENT, city TEXT, test_id INTEGER);
19 SELECT test.id FROM test JOIN loc ON test_id = id;
20 SELECT test.id FROM test WHERE id = ? UNION SELECT test.id FROM test WHERE id = ?;
21 SELECT id+test_id AS x,? FROM loc ORDER BY id,?/test_id LIMIT ?,100;
23 -- FIXME id is ambigous, should be detected
24 CREATE TABLE zuzu AS SELECT test.id,@text || city AS city, name FROM loc JOIN test ON test_id=id;
26 select test.name,other.name from test,test as other where test.id=other.id + @delta;
28 SELECT x,z FROM (SELECT name as x,
29 city || ' ' || descr as y,
30 max(length(city),random(*)) as z FROM test LEFT JOIN (SELECT name AS city FROM test WHERE id=@id)) WHERE x > @xlo AND z < @zhi;