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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL query "10%" in a field

Re: SQL query "10%" in a field

From: <shiuhlin_at_jshape.com>
Date: Wed, 13 Dec 2000 17:55:38 GMT
Message-ID: <918d6l$uc1$1@nnrp1.deja.com>

Thanks, it works.

In article <WpBZ5.19736$x6.11241610_at_news2.rdc2.tx.home.com>,   "Michael O'Neill" <mjoneill_at_email.com> wrote:
> <shiuhlin_at_jshape.com> wrote in message news:916el8$ci5$1_at_nnrp1.deja.com...
> > Hi,
> >
> > I have a problem needs help. My problem is : I have a table called
 "DOCS"
> > which contains a field called "NEWS", and I like to perform a query to
 find
> > all records which contains "10%" key words in the NEWS field. The "%" in
> > "10%" (10 - percent) isn't the wildcard character used in SQL. Now, can
> > anyone show me how to find the "10%" in NEWS?
> >
> > SELECT NEWS FROM DOCS WHERE NEWS LIKE ?????
> >
> > Shiuh-Lin Lee
>
> Use ESCAPE.
>
> SELECT *
> FROM docs
> WHERE news LIKE '%10/%%' ESCAPE '/';
>
> Directly from SQL Reference, Release 8.1.5 :
> ESCAPE identifies a single character as the escape character. The escape
> character can be used to cause Oracle to interpret % or _
> literally, rather than as a special character.
> If you wish to search for strings containing an escape character,
> you must specify this character twice. For example, if the
> escape character is ’/’, to search for the string ’client/server’,
> you must specify, ’client//server’.
> --
> Michael O'Neill
> mjoneill_at_email.com
>
>

Sent via Deja.com
http://www.deja.com/ Received on Wed Dec 13 2000 - 11:55:38 CST

Original text of this message

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