I have a varchar field that contains the street number (part of a
mailing address). It's a varchar because the field may occasionally
contain non-numeric characters, but normally it doesn't.

Let's call the field "x".

I have a record where x='3411'.

In spite of the fact that x is a varchar, the query

SELECT * WHERE x='3411'

returns no rows, while

SELECT * WHERE x=3411

returns the row containing x=3411.

Why doesn't the string comparison work on the varchar field?
I can't guarantee that there won't ever be non-numeric characters
in that field, or I would have made it an int instead. Help!

Thanks.



--
Tired of Earthlink? Get JustTheNet!
Nationwide Dialup, ISDN, DSL, ATM, Frame Relay, T-1, T-3, and more.
EARTHLINK AMNESTY PROGRAM: Buy a year, get two months free
More info coming soon to http://JustThe.net, or e-mail me!
B!ff: K3wl, w3'v3 r00t3D da [EMAIL PROTECTED] 0h CrAp, INC0M!Ng $%^NO CARRIER



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to