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

Cannot Connect to Database
I am writing an application to do annual reviews. I cannot get my script to work. Whenever it runs I

Get keys and values from an array
Hellow,

I have an array $Data with keys and values. With a foreach I can display all the valu

Impact of movement type 412 E on MAP
Hi

Usage of movement type 412 E is causing huge change in MAP .

Is there any r

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

Splitting Attributes
SQL> SELECT I_NAME, substr(I_NAME,1,instr(I_NAME,'O')) "First part",

substr(I_NAME, IN

Table control is disappearing from Screen
Hi Experts,

I have a screen with multiple table control(TC). Each table control has two c

Help adding strtolower( to my in_array
strtolower i need to add it to this to work, iuno how.

Code: $moderators = array('Admin', 'ba

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

Significance of BPM
Hi Experts,
I am a novice in BPM , I just want to know how BPM as permenant department is

php code to accept and delete incoming data
Using following HTML Code please show me how to write PHP code to accept and delete the incoming dat

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