what is the difference between AND
and OR
Operators?
In the online class shows that AND
displays a combination of 2 different conditions whats confusing is OR
does the same thing, here is an example:
select employee_id , first_name,job_id,salary FROM employees where department_id = 10 OR Department_ID = 20 AND job_id in ('FT_MGR','AC_MGR');
Advertisement
Answer
AND operator mean both (department_id = 10) is TRUE also (Department_ID = 20 ) is TRUE, result is TRUE
OR operator mean either (department_id = 10) is TRUE or (Department_ID = 20 ) is TRUE, result is TRUE