This topic is locked

SQL Filter value - need help

4/19/2008 1:56:47 PM
ASPRunnerPro General questions
L
leizleho author

I Have the following table employee below in my database and I would like to make a query in a query designer but the condition that I need to do is very difficult.

here it is: I need to select records where job is not clerk in deptno 10.
I would appreciate if anyone could help me do it in designer query.
Thanks,

Leizle
ename deptno job
KING 10 PRESIDENT

BLAKE 30 MANAGER

CLARK 10 MANAGER

JONES 20 MANAGER

MARTIN 30 SALESMAN

ALLEN 30 SALESMAN

TURNER 30 SALESMAN

JAMES 30 CLERK

WARD 30 SALESMAN

FORD 20 ANALYST

SMITH 20 CLERK

SCOTT 20 ANALYST

ADAMS 20 CLERK

MILLER 10 CLERK

D
dlangham 4/21/2008

Hi,
Try this query:

SELECT ename, deptno, job

FROM dbo.employee

WHERE (deptno <> 10) OR

(job <> 'CLERK')



This will give you the following results:
KING 10 PRESIDENT

BLAKE 30 MANAGER

CLARK 10 MANAGER

JONES 20 MANAGER

MARTIN 30 SALESMAN

ALLEN 30 SALESMAN

TURNER 30 SALESMAN

JAMES 30 CLERK

WARD 20 ANALYST

FORD 20 ANALYST

SMITH 20 CLERK

SCOTT 20 ANALYST

ADAMS 20 CLERK