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 easy SQL question?

Re: a easy SQL question?

From: <kirk_at_kaybee.org>
Date: 2000/02/17
Message-ID: <88hp9t$a1j$1@news-int.gatech.edu>#1/1

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

Original text of this message

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