Using BINARY has the effect of causing [:lower:] and [:upper:] in regular expressions to act as you would expe : Binary « String « SQL / MySQL






Using BINARY has the effect of causing [:lower:] and [:upper:] in regular expressions to act as you would expe

       
ct.
mysql>
mysql>
mysql> SELECT 'a' REGEXP '[[:upper:]]', BINARY 'a' REGEXP '[[:upper:]]';
+--------------------------+---------------------------------+
| 'a' REGEXP '[[:upper:]]' | BINARY 'a' REGEXP '[[:upper:]]' |
+--------------------------+---------------------------------+
|                        1 |                               0 |
+--------------------------+---------------------------------+
1 row in set (0.00 sec)

mysql>
mysql>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Using Binary with REGEXP
2.Force name values to be case sensitive using BINARY
3.A pattern match against a binary column is case sensitive.
4.Convert the output column to binary and sort that
5.To make tstr case sensitive, use BINARY:
6.Get the binary representation of the values 6 and 10.
7.Get the decimal values that belong to the binary representations 1001 and 111.
8.Binary Character String Comparison
9.Controlling Case Sensitivity of String Sorts
10.Mix binary and nonbinary string columns within a single table.