Original Post
I've got a little understanding problem with a basic SQL-Statement. I have a table where the field 'Id' is an unsigned integer which is also the primary key. Now I have the following query: SELECT * FROM table WHERE Id='foo' Due to the fact, that I compare 'Id' with a string I expect an empty result set. But the result set contains the one dataset where the Id equals 0. If there is no such dataset (with Id=0) the returned result set is empty. If I use instead the following statement, the behaviour is like I expect it: SELECT * FROM table WHERE Id LIKE 'foo' Can someone explain me, why the first statement returns a result set, even though Id is defined as an integer? Btw.: I've tested this on a MySQL-Server 4.0.18 and I couldn't find an explanation in the documentation...