案例:查询工作岗位是MANAGER和SALESMAN的员工:
方法一:(信息在同一张表中)
select ename,job from emp where job = 'MANAGER' or job = 'SALESMAN';
方法二:(信息在同一张表中)
select ename,job from emp where job in ('MANAGER','SALESMAN');
方法三:(使用union)该方法效率较高。还有特殊情况下需要使用此方法(比如信息不在同一张表的情况)
select ename,job from emp where job = 'MANAGER'
union
select ename,job from emp where job = 'SALESMAN';