Get the binary representation of the values 6 and 10. : Binary « String « SQL / MySQL






Get the binary representation of the values 6 and 10.

       
mysql>
mysql>
mysql> SELECT CONV(6,10,2), CONV(10,10,2), BIN(8), BIN(10);
+--------------+---------------+--------+---------+
| CONV(6,10,2) | CONV(10,10,2) | BIN(8) | BIN(10) |
+--------------+---------------+--------+---------+
| 110          | 1010          | 1000   | 1010    |
+--------------+---------------+--------+---------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Using Binary with REGEXP
2.Force name values to be case sensitive using BINARY
3.Using BINARY has the effect of causing [:lower:] and [:upper:] in regular expressions to act as you would expe
4.A pattern match against a binary column is case sensitive.
5.Convert the output column to binary and sort that
6.To make tstr case sensitive, use BINARY:
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.