ClickHouse/dbms/tests/queries/0_stateless/00116_storage_set.sql

30 lines
1.1 KiB
MySQL
Raw Normal View History

2019-06-07 14:59:41 +00:00
DROP TABLE IF EXISTS set;
DROP TABLE IF EXISTS set2;
2015-01-27 00:52:03 +00:00
2019-06-07 14:59:41 +00:00
CREATE TABLE set (x String) ENGINE = Set;
2015-01-27 00:52:03 +00:00
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s NOT IN set;
INSERT INTO set VALUES ('Hello'), ('World');
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
RENAME TABLE set TO set2;
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
2019-06-07 14:59:41 +00:00
INSERT INTO set2 VALUES ('Hello'), ('World');
2015-01-27 00:52:03 +00:00
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
2019-06-07 14:59:41 +00:00
INSERT INTO set2 VALUES ('abc'), ('World');
2015-01-27 00:52:03 +00:00
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
DETACH TABLE set2;
2019-11-11 11:34:03 +00:00
ATTACH TABLE set2; -- (x String) ENGINE = Set;
2015-01-27 00:52:03 +00:00
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set2;
RENAME TABLE set2 TO set;
SELECT arrayJoin(['Hello', 'test', 'World', 'world', 'abc', 'xyz']) AS s WHERE s IN set;
2019-06-07 14:59:41 +00:00
DROP TABLE set;