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

Home -> Community -> Usenet -> c.d.o.tools -> Re: a "not like" operator?

Re: a "not like" operator?

From: <xmark.powell_at_eds.com.x>
Date: 9 Apr 2001 20:15:48 GMT
Message-ID: <9at59k$d9i$1@news.netmar.com>

In article <9ask9f$oqg$1_at_wiscnews.wiscnet.net>, Huoy-Jii Khoo <khoo_at_mcw.edu> writes:
>Hi,
>
>I know there is a like operator and I can't the "not like" operator.... Is
>there something like that in Oracle?
>
>What I was trying to do is to search string with anything EXCEPT those
>starting with 03 and 04.....
>
>Thanks in advance,
>jii
>

I am not sure what you mean by "I can't the "not like" operator" but here is an example of using 'not like':

UT1> select * from marktest;
FLD1 FLD2 FLD3 FLD4

---------- ---------- --------- ----------
1                   6 09-DEC-00          1
2                   6 10-DEC-00          2
3                   6 11-DEC-00          3
4                   6 12-DEC-00          4
5                   6 24-JAN-01          5
6                   6 23-JAN-01         21
7                   6 23-JAN-01         21
8                   6 22-JAN-01         21
9                   6 22-JAN-01         21
10                  6 25-DEC-00         10

10 rows selected.

UT1> select *
  2 from marktest
  3 where fld4 not like '2%';

FLD1 FLD2 FLD3 FLD4

---------- ---------- --------- ----------
1                   6 09-DEC-00          1
3                   6 11-DEC-00          3
4                   6 12-DEC-00          4
5                   6 24-JAN-01          5
10                  6 25-DEC-00         10


If you can not code a 'not like' you might be able to use a not in subquery where the subquery feteched the values you did not want, but this would probably be slow.

Received on Mon Apr 09 2001 - 15:15:48 CDT

Original text of this message

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