有一个帐户scott/tiger里面有emp和dept两个表小弟求解一道题:
显示部门工资总和高于雇员工资总和1/3的部门名称及工资总和!~~求高手指点~应该怎样写!!

解决方案 »

  1.   

    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呢,试着写了
      

  2.   


    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)