Subject Re: SELECT ... WHERE ... LIKE ... question (Firebird 1.02)
Author wackoj123 <wackoj123@yahoo.com>
Hi Luc,

> are you really sure you need 2 '_' in front of the AB?
> (you will only get results with the exact length of
> four where the ending is AB)
>
> What are the results for LIKE "%AB"?

I have a CHAR(5) field with codes like:
0101, 0102, 0201, 01AB, 01DAB, 02AB, 02AAB, 02BC, 0304, 0310
and many alike.

When selecting I need to get the __AB's with two characters in front
of the letters, but not the ones with __AAB I would get when using
a "%AB".

In the meantime I have found out that when using the wildcard _ in a
LIKE query, this is a problem for both Interbase and Firebird: when I
add a space after the "AB", so using WHERE Code LIKE "__AB ", then I
do get the correct ones.
Apparently the LIKE with _ wildcards looks at all 5 characters of the
Code field. Can you confirm this?

Jack