1 SELECT strftime('%s','now');
2 CREATE TABLE test (x INT, `key` VARBINARY(200));
3 SELECT * FROM test WHERE x IS NOT NULL;
4 CREATE INDEX `key` ON test(`key`(20));
5 SELECT avg(x) FROM test;
6 SELECT count(*) FROM test;
7 SELECT x FROM test WHERE ? >= `key` ORDER BY `key` DESC LIMIT 1;
8 SELECT x FROM test WHERE `key` < ?;
10 CREATE TABLE appointments (alert_at DATETIME);
11 INSERT INTO `appointments` (
14 NOW() + INTERVAL @delay SECOND
16 SELECT SUM(CASE WHEN x > 10 THEN 1 ELSE 0 END) FROM test;
17 -- delete from txn_ranges
18 -- where id in (@tr1_id, @tr2_id)
19 -- and not exists (select 1 from workareas where txn_range_id = txn_ranges.id)
21 CREATE TABLE issue14 (x integer);
22 INSERT INTO issue14 (x) VALUES (@x);
23 INSERT INTO issue14 SET x = @x;
24 INSERT INTO issue14 (x) SELECT @x;
26 INSERT INTO test VALUES (20, 'twenty') ON DUPLICATE KEY UPDATE x = x + ?;
27 INSERT INTO test VALUES (20, 'twenty') ON DUPLICATE KEY UPDATE x = VALUES(x) + ?;
28 INSERT INTO test VALUES (20, $$twenty$$);
29 INSERT INTO test VALUES (200,
36 RETURN ($1 ~ $q$[\t\r\n\v\\]$q$);
40 INSERT INTO `test` (`x`, `key`) VALUES
45 INSERT INTO test VALUES
51 SELECT count(*) > 0 FROM test;
52 SELECT count(*) * avg(x) FROM test;
55 INSERT INTO test VALUES
60 INSERT INTO `appointments` ( `alert_at`) VALUES (@alert);
61 INSERT INTO `appointments` ( `alert_at`) VALUES (FROM_UNIXTIME(@alert));
64 SELECT COUNT(x) FROM test;
67 SELECT COUNT(DISTINCT x), SUM(DISTINCT x) FROM test;
70 SELECT 0 <=> 0, 0 <=> null, null <=> 0, null <=> null;
73 SELECT 0 is 0, 0 is null, null is 0, null is null;
76 SELECT 42 is not distinct from null, 42 is distinct from null;