BINARY
is shorthand for str
CAST(
. 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(
expr
USINGtranscoding_name
)The
CONVERT()
andCAST()
functions take a value of one type and produce a value of another type.The
type
can be one of the following values: