BINARY is shorthand for strCAST(. str AS BINARY)
Note that in some contexts, if you cast an indexed column to BINARY, MySQL is not able to use the index efficiently.
-
The
CAST()function takes a value of one type and produce a value of another type, similar toCONVERT(). See the description ofCONVERT()for more information. -
CONVERT(,expr,type)CONVERT(exprUSINGtranscoding_name)The
CONVERT()andCAST()functions take a value of one type and produce a value of another type.The
typecan be one of the following values:
本文介绍了MySQL中使用CAST()和CONVERT()函数进行的数据类型转换,包括字符串到二进制、日期时间等类型的转换,并提到了在某些情况下对索引列进行类型转换可能会影响查询效率。
1735

被折叠的 条评论
为什么被折叠?



