SET Type : Set « Data Types « MySQL Tutorial






The SET type stores a list of values.

A SET is a string object that can have zero or more values.

In a SET type, you can choose more than one option to store.

A SET type can contain up to 64 items.

Each of which must be chosen from a list of values.

Multiple set members are separated by commas (',').

SET member values should not contain commas.

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

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

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

mysql>








10.19.Set
10.19.1.SET Type
10.19.2.SET column type
10.19.3.Using the SET type
10.19.4.If you set a SET column to an unsupported value, the value is ignored and a warning is issued
10.19.5.Search for SET values using the FIND_IN_SET() function
10.19.6.Search for SET values using the LIKE operator
10.19.7.Looking for values containing the first set member
10.19.8.MySQL stores SET and ENUM as numbers
10.19.9.Looking for an exact match in a set column