Oracle
Logical Conditions
Figo Kim
2006. 8. 27. 13:19
- AND : Returns TRUE if both component conditions are true
False > Null > True
SELECT employee_id, last_name,job_id,salary FROM employees
WHERE salary >= 10000 and job_id LIKE '%MAN%'
- OR : Returns TRUE if either component conditions are true
True > Null > False
SELECT employee_id, last_name,job_id,salary FROM employees
WHERE salary >= 10000 or job_id LIKE '%MAN%'
- NOT : Returns TRUE if the following condition is false
ex) NOT BETWEEN~AND~ , NOT LIKE , NOT IN , IS NOT NULL
select last_name,job_id from employees
where job_id not in('IT_PROG','ST_CLERK','SA_REP')