BINARY

Description: Causes the string following the word BINARY to be typecast as a binary string.

Its typical use is to force a case-sensitive comparison, even though the string is not already binary data or a BLOB column type. Was introduced in version 3.23.0.

Examples:

  • SELECT 'A'='a' returns 1.

  • SELECT BINARY 'A'='a' returns 0.

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.