Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Wildcard characters in a LIKE statement
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 - 13:48:57 CST