Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to search for %
Thanks for all the help
The problem seems to be that I set my escape to \ in the sqlplus environment
and it didn't seem work - when I set it back to nothing and then used the
escape clause on the sql itself the query then worked. Another mystery of
Oracle.
.... . .-.. .--. .. ...- . -... . . -. .--. .-. --- -... . -..
John B. Shaw
Intergraph Public Safety
mailstop LR24A4
jbshaw_at_ingr.com
256-730-8038
All the usual disclaimers and some of the certifications
-----Original Message-----
From: Deshpande, Kirti [mailto:kirti.deshpande_at_verizon.com]
Sent: Wednesday, October 18, 2000 3:56 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: How to search for %
Try this
select * from test where a like '%\%%' escape '\';
> -----Original Message-----
> From: Shaw, John B [SMTP:jbshaw_at_ingr.com]
> Sent: Wednesday, October 18, 2000 3:21 PM
> To: Multiple recipients of list ORACLE-L
> Subject: How to search for %
>
> I need to find a '%' in char field (8.05) and I can't seem to figure out
> the
> right sql to get it - the following are what I've tried so far (\ is the
> escape).
>
> SQL> select * from test where a like '\%';
> A
> -----
> ab%cd
> abcd
> efgab
>
> SQL> select * from test where a like '%\%%';
> A
> -----
> ab%cd
> abcd
> efgab
>
> SQL> select * from test where a like '%\%';
> A
> -----
> ab%cd
> abcd
> efgab
>
> SQL> select * from test where a like '\%%';
> A
> -----
> ab%cd
> abcd
> efgab
>
>
> .... . .-.. .--. .. ...- . -... . . -. .--. .-. --- -... . -..
> John B. Shaw
> Intergraph Public Safety
> mailstop LR24A4
> jbshaw_at_ingr.com
> 256-730-8038
> All the usual disclaimers and some of the certifications
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Shaw, John B
> INET: jbshaw_at_ingr.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Deshpande, Kirti INET: kirti.deshpande_at_verizon.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You mayReceived on Thu Oct 19 2000 - 09:01:56 CDT