Thanks to @fengyunzhanjin and @苏生Buhuo for their answers. I excerpted the following explanation from the mysql official website, which can answer my doubts very well:
Comparisons that use floating-point numbers (or values that are converted to floating-point numbers) are approximate because such numbers are inexact. This might lead to results that appear inconsistent: Example given on the official website As follows:
id=201511051505538905 Its data type is int and the data type of your id is string. Of course it cannot be found, but you can convert it to int cast(id as int)
where id=201511051505538905 id is of char type and if you use numbers to compare, mysql will convert the string into a number, which is 0 201511051505538905 != 0
Thanks to @fengyunzhanjin and @苏生Buhuo for their answers. I excerpted the following explanation from the mysql official website, which can answer my doubts very well:
https://dev.mysql.com/doc/refman/5.7/en/type-conversion.html
id=201511051505538905
Its data type is int
and the data type of your id is string. Of course it cannot be found, but you can convert it to int
cast(id as int)
where id=201511051505538905
id is of char type and if you use numbers to compare, mysql will convert the string into a number, which is 0 201511051505538905 != 0