Select only one value among the set : Set « Data Type « SQL / MySQL






Select only one value among the set

      
mysql>
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>
mysql> SELECT * FROM testset WHERE fontattr='italic';
Empty 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.Use SET to have arbitrary combinations
3.Set multiple values
4.To identify SET values that share common elements
5.To break down a set of observations and show each count as a percentage of the total