select deptname,sum(salary) from employee,dept where employee.deptno = dept.deptno group by deptname having sum(salary)*3 > (select sum(salary) from employee) 刚重装系统了,还没有安装Oracle呢,试着写了
select deptname,sum(salary) from employee a,dept b where a.deptno = b.deptno group by deptname having sum(salary)*3 > (select sum(salary) from employee where deptno=a.deptno)
from employee,dept
where employee.deptno = dept.deptno
group by deptname
having sum(salary)*3 > (select sum(salary) from employee)
刚重装系统了,还没有安装Oracle呢,试着写了
select deptname,sum(salary)
from employee a,dept b
where a.deptno = b.deptno
group by deptname
having sum(salary)*3 > (select sum(salary) from employee where deptno=a.deptno)