Skip to content
Advertisement

MySQL showing strange result

I have a table called tabela1512823699024883 that looks like this: enter image description here

On which I run query like this:

JavaScript

This query does not make sense, because age column is int type and I’m looking for string value in my query, but MySQL still returns no empty rows whatsoever. Here is what query returned: enter image description here So age row does not contains male value in neither rows returned. How can this be possible?

Advertisement

Answer

Same issue will occur with casting a string to an integer type.

JavaScript

However if a number is supplied within the string.

JavaScript

To resolve the issue use BINARY on the column, which will also cause the textual value to become case-sensitive.

JavaScript

Alternatively to utilize a case-insensitive BINARY criteria CONVERT() the value to the desired character-set and then specify a case-inventive collation. [sic]

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement