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
Dibo Chen wrote:
> try SELECT * WHERE x like '3411'.
Like doesn't work either. I tried it.
mysql> select ppn from main where streetnum=3411;
+---+
| ppn |
+---+
| 01A003290 |
| 01A016440 |
+---+
2 rows in set (3.04 sec)
mysql> select pp
Dibo Chen wrote:
> probably there are spaces?
D'oh! Yes, a leading space.
This query...
select length(streetnum),streetnum from main where streetnum=3411;
produced a length of five, not four.
I'll use the trim() function & compare apples to apples. :) Thanks!
--
Tired of Earthlink? Get Jus