Топ-100
top of page
CerebroSQL

BINARY OPERATOR

База данных: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

Topic

Syntax:
BINARY expr

The BINARY operator converts the expression to a binary string (a
string that has the binary character set and binary collation). A
common use for BINARY is to force a character string comparison to be
done byte by byte using numeric byte values rather than character by
character. The BINARY operator also causes trailing spaces in
comparisons to be significant. For information about the differences
between the binary collation of the binary character set and the _bin
collations of nonbinary character sets, see
https://dev.mysql.com/doc/refman/8.0/en/charset-binary-collations.html.

URL: https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html

Example

mysql> SELECT 'a' = 'A';
-> 1
mysql> SELECT BINARY 'a' = 'A';
-> 0
mysql> SELECT 'a' = 'a ';
-> 1
mysql> SELECT BINARY 'a' = 'a ';
-> 0

bottom of page