Mega Code Archive

 
Categories / MySQL / Data Type
 

With ENUM you can manage a list of up to 65,535 character strings

mysql> mysql> CREATE TABLE testenum     -> (color ENUM ('red', 'green', 'blue', 'black', 'white')); Query OK, 0 rows affected (0.01 sec) mysql> mysql> mysql> INSERT testenum VALUES ('red'); Query OK, 1 row affected (0.00 sec) mysql> mysql> mysql> SELECT * FROM testenum WHERE color='red'; +-------+ | color | +-------+ | red   | +-------+ 1 row in set (0.00 sec) mysql> mysql> drop table testenum; Query OK, 0 rows affected (0.00 sec)