Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Wildcard characters in a LIKE statement
Thanks for the rapid response (I love these newsgroups!). The 'ESCAPE'
keyword was the one that I just could not remember!! It's probably been at
least a half dozen years since I needed to do that.
Thanks again Martin.
Rich Woodland.
Magic Interface, Ltd.
Martin Doherty wrote:
> The _ and % only have wildcard meanings in a LIKE comparison, so if you
> are not using LIKE you can treat them like any other character:
>
> WHERE INSTR(charcol, '_') > 0 OR INSTR(charcol, '%') > 0
>
> or, to use LIKE you can specify an ESCAPE character to remove the
> wildcard meaning from the character following:
>
> WHERE charcol LIKE '%\_%' ESCAPE '\' -- this will find rows where the
> _ character occurs anywhere in the column.
>
> Martin Doherty
>
> Richard Q Woodland wrote:
>
> >I have a need to search for columns containing the '_' character. Of
> >course, by default, this character is one of the two wildcard
> >characters, and so cannot be searched using the LIKE statement.
> >
> >Does anybody know how to perform this search (for either an underscore
> >character or a percent sign character)?
> >
> >Please reply both to the newsgroup (so others may have their curiosity
> >satisfied ;) ) and to my e-mail address directly.
> >
> >Thanks,
> >
> >Rich Woodland.
> >Magic Interface, Ltd.
> >
> >
> >
> >
Received on Thu Dec 19 2002 - 14:08:34 CST