MySQL stores SET and ENUM as numbers : Set : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » Set »

 

MySQL stores SET and ENUM as numbers


They can be manipulated using numeric operations.

mysql>
mysql> CREATE Table Test(
    ->     Advertiser SET('A','B','C')
    -> );
Query OK, rows affected (0.03 sec)

mysql>
mysql>
mysql> INSERT INTO Test (Advertiservalues('A, B');
Query OK, row affected, warning (0.00 sec)

mysql>
mysql>
mysql> SELECT FROM Test WHERE Advertiser = 1;
+------------+
| Advertiser |
+------------+
| A          |
+------------+
row in set (0.02 sec)

mysql>
mysql> SELECT Advertiser, Advertiser + FROM Test;
+------------+----------------+
| Advertiser | Advertiser + |
+------------+----------------+
| A          |              |
+------------+----------------+
row in set (0.00 sec)

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

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» Set