Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Querying for Strings with containing Wildcards

Re: Querying for Strings with containing Wildcards

From: Stéphane ROMANET <sromanet53_at_hotmail.com>
Date: Tue, 12 Nov 2002 11:35:55 +0100
Message-ID: <aqqlpv$l71$1@news-reader10.wanadoo.fr>


There's another solution that is the use of ESCAPE :

SELECT COUNT(*) FROM Table1 WHERE Field1 like '%\%%' ESCAPE '\'

That means the char after the escape symbol ( back slash in that case ) should be taken as real and not as a wildcard char.

Stef

"Hulk" <HulknoooSpam_at_unitywars.com> a écrit dans le message de news: aqp14b$c9k02$1_at_ID-68406.news.dfncis.de...
> Hey guys,
>
> I was wondering if I could get a hint on querying for strings containing a
> wildcard, notable the % sign. Against our advice one our clients has
> created many values in their database containing percent signs and would
now
> like a list of the appropriate records so they can delete them.
>
> Obviously the following does not work,
>
> select field from table where field = 'xx%'
>
> I tried the following
>
> set escape \
>
> select field from table
>
> where field = 'xx\%';
>
> This kinda worked excpet it does not seem to allow us to search for any
and
> all records containing a percent sign.
>
> Any tips of advice would be appreciated.
>
>
>
>
>
Received on Tue Nov 12 2002 - 04:35:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US