2019-08-01 19:18:36 +00:00
|
|
|
|
2020-02-11 18:05:08 +00:00
|
|
|
DROP TABLE IF EXISTS set_index_not;
|
2019-08-01 19:51:51 +00:00
|
|
|
|
2020-02-11 18:05:08 +00:00
|
|
|
CREATE TABLE set_index_not
|
2019-08-01 19:18:36 +00:00
|
|
|
( name String, status Enum8('alive' = 0, 'rip' = 1),
|
|
|
|
INDEX idx_status status TYPE set(2) GRANULARITY 1
|
|
|
|
)
|
|
|
|
ENGINE = MergeTree() ORDER BY name SETTINGS index_granularity = 8192;
|
|
|
|
|
2020-02-11 18:05:08 +00:00
|
|
|
insert into set_index_not values ('Jon','alive'),('Ramsey','rip');
|
2019-08-01 19:51:51 +00:00
|
|
|
|
2020-02-11 18:05:08 +00:00
|
|
|
select * from set_index_not where status!='rip';
|
|
|
|
select * from set_index_not where NOT (status ='rip');
|
2019-08-01 19:18:36 +00:00
|
|
|
|
2020-02-11 18:05:08 +00:00
|
|
|
DROP TABLE set_index_not;
|