mysql VARCHAR acting like INT
Posted: Mon Oct 05, 2009 12:22 pm
Hi, All.
I have a table that contains a varchar(10) column named weird_field. In this column, only integers reside (e.g., 3010101009). When I do this:
no records are returned, even though there is a record with weird_field = '3010101009'.
However, if I do this:
the appropriate records are returned. I don't think this should be the case, right? Because it's a varchar column, shouldn't the 3010101009 be quoted? It's messing up some joins I'm trying to do, and I just don't get it.
Thanks
I have a table that contains a varchar(10) column named weird_field. In this column, only integers reside (e.g., 3010101009). When I do this:
Code: Select all
select * from table where weird_field = '3010101009'
However, if I do this:
Code: Select all
select * from table where weird_field = 3010101009
Thanks