Loading lesson path
Concept visual
Start at both ends
Convert a value to a binary string:
SELECT BINARY "W3Schools.com";The BINARY function converts a value to a binary string.
CAST(value AS BINARY).
value
Required. The value to convert
From MySQL 4.0
Formula
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";Formula
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";❮ MySQL Functions