- CREATE TABLE db_set (
- set1 SET('x', 'y', 'z') NOT NULL,
- enum1 ENUM('one', 'two', 'three') NOT NULL
- );
- truncate table db_set;
- insert into db_set values(1,1); -- 'x', 'one'
- insert into db_set values(2,2); -- 'y', 'two'
- insert into db_set values(3,3); -- 'x,y', 'three'
- insert into db_set values(3,1); -- 'x,y', 'one'
- insert into db_set values(4,1); -- 'z', 'one'
- insert into db_set values(5,1); -- 'x,z', 'one'
- insert into db_set values(6,1); -- 'y,z', 'one'
- insert into db_set values(7,1); -- 'x,y,z', 'one'
- insert into db_set values(8,1); -- -- one
- insert into db_set values(9,1); -- 'x', 'one'
- insert into db_set values(10,1); -- 'y', 'one'
- select * from db_set;
- truncate table db_set;
- CREATE TABLE db_set2 (
- set1 SET('a', 'b', 'c','d') NOT NULL
- ); -- a=1,b=2,c=4,d=8
- truncate table db_set2;
- insert into db_set2 values(1); -- a
- insert into db_set2 values(2); -- b
- insert into db_set2 values(3); -- a,b
- insert into db_set2 values(4); -- c
- insert into db_set2 values(5); -- a,c
- insert into db_set2 values(6); -- b,c
- insert into db_set2 values(7); -- a,b,c
- insert into db_set2 values(8); -- d
- insert into db_set2 values(9); -- a,d
- insert into db_set2 values(10);-- b,d
- select * from db_set2;
- truncate table db_set2;