Subject | Re: LIKE problem |
---|---|
Author | a987oau7923898723 |
Post date | 2003-04-09T02:41:17Z |
> Did a quick test in the example database:Hmm, that works for me too.
>
> insert into country values ('test%', 'oink');
> select * from country where 'testum' like country;
>
> Output:
>
> COUNTRY CURRENCY
> =============== ==========
>
> test% oink
>
OK, figured out what the problem was: I used CHAR(n) in the column
definition, which is wrong because then there are extra spaces
appened to the comparison value and so it doesn't match (unless the
value being tested also happens to have that many spaces at the end).
The reason I didn't notice my mistake when I tried it on mysql was
that mysql can (and does) silently change CHAR(n) to VARCHAR(n)...
Thanks for your help :)