BINARY casts the string to a binary string : BINARY : Cast Functions Operators MySQL TUTORIALS


MySQL TUTORIALS » Cast Functions Operators » BINARY »

 

BINARY casts the string to a binary string


BINARY causes the comparison to be case sensitive.

BINARY also causes trailing spaces to be significant.

BINARY str is shorthand for CAST(str AS BINARY).

mysql>
mysql> SELECT 'a' 'A';
+-----------+
'a' 'A' |
+-----------+
|         |
+-----------+
row in set (0.00 sec)

mysql> SELECT BINARY 'a' 'A';
+------------------+
| BINARY 'a' 'A' |
+------------------+
|                |
+------------------+
row in set (0.00 sec)

mysql> SELECT 'a' 'a ';
+------------+
'a' 'a ' |
+------------+
|          |
+------------+
row in set (0.00 sec)

mysql> SELECT BINARY 'a' 'a ';
+-------------------+
| BINARY 'a' 'a ' |
+-------------------+
|                 |
+-------------------+
row in set (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Cast Functions Operators
» BINARY