Use SET to have arbitrary combinations : Set « Data Type « SQL / MySQL






Use SET to have arbitrary combinations

     
mysql>
mysql> CREATE TABLE testset
    -> (fontattr SET ('bold', 'italic', 'underlined'));
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> INSERT testset VALUES ('bold,italic');
Query OK, 1 row affected (0.00 sec)

mysql>
mysql> select * from testset;
+-------------+
| fontattr    |
+-------------+
| bold,italic |
+-------------+
1 row in set (0.00 sec)

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

mysql>

   
    
    
    
    
  








Related examples in the same category

1.SET: Combination of up to 255 strings
2.Set multiple values
3.To identify SET values that share common elements
4.To break down a set of observations and show each count as a percentage of the total
5.Select only one value among the set