mysql> mysql> CREATE TABLE myset (col SET('a', 'b', 'c', 'd')); Query OK, 0 rows affected (0.05 sec)
mysql> INSERT INTO myset (col) VALUES ('a,d'), -> ('d,a'), -> ('a,d,a'), -> ('a,d,d'), -> ('d,a,d'); Query OK, 5 rows affected (0.00 sec) Records: 5 Duplicates: 0 Warnings: 0
mysql> SELECT col FROM myset; +------+ | col | +------+ | a,d | | a,d | | a,d | | a,d | | a,d | +------+ 5 rows in set (0.00 sec)
mysql> mysql> SELECT * FROM myset WHERE col & 1; +------+ | col | +------+ | a,d | | a,d | | a,d | | a,d | | a,d | +------+ 5 rows in set (0.00 sec)
mysql> mysql> drop table myset; Query OK, 0 rows affected (0.00 sec)
|