HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
MySQL Functions : Convert a value to a binary string
The BINARY function converts a value to a binary string.
This function is equivalent to using CAST(value AS BINARY).
BINARY value
Parameter | Description |
---|---|
value | Required. The value to convert |
Works in: | From MySQL 4.0 |
---|
Here MySQL performs a character-by-character comparison of "HELLO" and "hello" and return 1 (because on a character-by-character basis, they are equivalent):
SELECT "HELLO" = "hello";
Here MySQL performs a byte-by-byte comparison of "HELLO" and "hello" and return 0 (because on a byte-by-byte basis, they are NOT equivalent):
SELECT BINARY "HELLO" = "hello";