I have a very strange behavior that I cannot understand in my SQL DB (I use MySQL 5.5.8):
I have a varchar (10) name in the table: joe.
If you run sql as follows:
SELECT ID FROM `names` WHERE `name` = 'joe '
I get one result: joe, but this is wrong because in the table I don't have any "joe" (with a space at the end. I only have "joe" (no spaces)
However, if I run:
SELECT ID FROM `names` WHERE `name` LIKE 'joe '
I get, as I expect: nothing. As far as I know, there should be an βexactβ match, while, as more freely, you can use it with substrings and%.
What am I missing?
sql database mysql
dk766
source share