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:

Did you know?Explore Trending and Topic pages for more stories like 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

Read from forum
Haven't written anything forever and I would like to get back.
What I'm trying to do is getting t

do while conditions
i want to display 6 images in a 2x3 table
now what would be the correct logic to
count that th

DYNPRO_FIELD_CONVERSION
Hi gurus,

I got a dump when I run one of my program. the dump is described below:

quotes changing
hi all

in my content

opening quotes " changes to “

close qu

Match 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

(sub)screen resize modification doesn't work after ECC 6 EhP 4 installation
Hello,

We have previously extended the size of the custom data tab on PO transaction ME23

How can i steam a video on my PHP site? (non YouTube)
Basically I have a PHP site and don't want to give page rank to YouTube. I just want to stream a bas

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

tag inside php...
hi


Code: <?php
echo "<td width="$columnWidth%" align=&

opening a window with after form submission
I know this this forum has nothing to do with JS, but i'm trying to use it with my php script.
<

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