Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: a easy SQL question?
yliu_at_creighton.edu wrote:
: I have a table called dept. Two of the fields in dept table is emp_name
: and deptno. I want to select every emp_name from dept table except for two
: deptno (R% and X%). I am confused on which operator to use: OR or AND.
: My SQL statement is like:
: select emp_name, deptno
: from dept
: where ...
: and (deptno not like X% or deptno not like R%)
: and ...;
You want to do (extra parenthesis added for clarity):
((deptno not like X%) and (deptno not like R%))
-- Kirk Bauer -- CmpE, Georgia Tech -- kirk_at_kaybee.org -- Avid Linux User GT Sport Parachuting Club! http://cyberbuzz.gatech.edu/skydive Opinions expressed are my own, but they should be everybody's.Received on Thu Feb 17 2000 - 00:00:00 CST
![]() |
![]() |