select * from emp where scal > any (select scal from emp where deptno=10 )and deptno <> 10;
方法二
思路:
-- 查询出工资大于部门编号为10的工资最小值
-- 其他部门的员工信息
select * from emp where scal > (select min(scal) from emp where deptno =10) and deptno <> 10;
此语法编写的适合的范围较广
2.查询工资大于部门编号是30的所有的员工工资的员工信息
运用all语句
select * from emp where scal > all (select scal from emp where deptno =30) and deptno <>30;
只需选取大于部门编号为30的最大工资
select * from emp where scal > (select max(scal) from emp where deptno =30) and deptno <> 30;
emp 信息1.查询工资大于部门编号是10的任意的一个员工工资即可的其他部门的员工信息any 任意一个 all 所有方法一select * from emp where scal > any (select scal from emp where deptno=10 )and deptno <> 10;方法二思路: -- 查询出工资大于部门编号为10的工资最小值...