12.8.1 String Comparison Functions and Operators字符串比较函数和运算符

Table 12.13 String Comparison Functions and Operators字符串比较函数和运算符

Name名称Description描述
LIKESimple pattern matching简单模式匹配
NOT LIKENegation of simple pattern matching简单模式匹配的否定
STRCMP()Compare two strings比较两个字符串

If a string function is given a binary string as an argument, the resulting string is also a binary string. 如果给字符串函数一个二进制字符串作为参数,则得到的字符串也是二进制字符串。A number converted to a string is treated as a binary string. 转换为字符串的数字被视为二进制字符串。This affects only comparisons.这只影响比较。

Normally, if any expression in a string comparison is case-sensitive, the comparison is performed in case-sensitive fashion.通常,如果字符串比较中的任何表达式区分大小写,则以区分大小写的方式执行比较。

If a string function is invoked from within the mysql client, binary strings display using hexadecimal notation, depending on the value of the --binary-as-hex. 如果从mysql客户机中调用字符串函数,则二进制字符串将使用十六进制表示法显示,具体取决于--binary-as-hex的值。For more information about that option, see Section 4.5.1, “mysql — The MySQL Command-Line Client”.有关该选项的更多信息,请参阅第4.5.1节,“mysql命令行客户端”