From: Type Conversion in Expression Evaluation
When an operator is used with operands of different types,
type
conversion occurs to make the operands compatible.
Some
conversions occur implicitly.
To get the idea of the how MySql makes these type conversions try these explicit conversions:
SELECT
cast('123abc' as unsigned),
cast('1abc23' as unsigned),
cast('abc123' as unsigned)
will have this result:
| col1 | col2 | col3 |
| ---- | ---- | ---- |
| 123 | 1 | 0 |
You may have guessed that for any string that you try to convert to an integer,
the result is the integer value that consists of the starting numerical chars of the string if there are any, or 0 if there are not.
So in your case '123sks' is converted (implicitly) to 123.
To get FALSE from the comparison, convert 123 to string:
WHERE '123sks' = cast(123 as char(10))