mysql VARCHAR acting like INT


Posted on 16th Feb 2014 07:03 pm by admin

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:

Line number On/Off | Expand/Contract select * from table where weird_field = '3010101009'

no records are returned, even though there is a record with weird_field = '3010101009'.

However, if I do this:

Line number On/Off | Expand/Contract select * from table where weird_field = 3010101009

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

No comments posted yet

Your Answer:

Login to answer
284 Like 49 Dislike
Previous forums Next forums
Other forums

Need help with a mail notify function
I was tasked with setting up a site that's been prewritten. The site is basically a form that captur

Need help with basic sql
Hi,

I am using oracle 10g, and having some small doubts related to sql , here goes the si

function to return url
Hi,

Can you guys help me giving a function that takes all the contents in a particular field

iMatch stored value with the current value in a loop
Hello,

I have a MySQL db were I store articles in.

I have a form to fill these article

Rounding a number queried from a database
I know that to display a rounded number you just do echo "round($number)";. But how would

Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste

PHP hyperlinks generator - HELP plz
Hi

I need some help to get this done using php:


1 - I have few hyperlinks say 500

Google voice
I currently have a form in html, but I want it in php so the information is not in the source code.<

RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to a

need help with date function
i have following form for date

Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash