Use numeric operation in ENUM type column : ENUM « Data Types « MySQL Tutorial






mysql>
mysql>
mysql> CREATE TABLE Test(
    ->     XY ENUM('Y','N') DEFAULT 'N',
    ->     Size ENUM('S','M','L','XL','XXL'),
    ->     Color ENUM('Black','Red','White')
    -> );
Query OK, 0 rows affected (0.03 sec)

mysql>
mysql> Insert into Test (XY, Size, Color) values ('Y','S','Black');
Query OK, 1 row affected (0.01 sec)

mysql>
mysql> select * from Test;
+------+------+-------+
| XY   | Size | Color |
+------+------+-------+
| Y    | S    | Black |
+------+------+-------+
1 row in set (0.00 sec)

mysql>
mysql> select * from Test where size = 0;
Empty set (0.02 sec)

mysql>
mysql> drop table Test;
Query OK, 0 rows affected (0.00 sec)

mysql>








10.10.ENUM
10.10.1.ENUM Type
10.10.2.Possible value for a ENUM column
10.10.3.ENUM with default value
10.10.4.Use ENUM type column
10.10.5.Inserting data to ENUM type column
10.10.6.Use numeric operation in ENUM type column
10.10.7.If you retrieve an ENUM value in a numeric context, the column value's index is returned