Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: a "not like" operator?
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.