ORA-00979: not a GROUP BY expression

select e.deptno,
d.deptno,sum(e.sal) from dept d,e emp
where d.deptno=e.deptno group by e.deptno

d.deptno,sum(e.sal) from d dept,e emp
*
ERROR at line 2:
ORA-00979: not a GROUP BY expression


GROUP BY clause should contain all the columns
(without group function) in the query

select e.deptno,
d.deptno,sum(e.sal) from dept d,emp e
where d.deptno=e.deptno group by e.deptno,d.deptno;

Comments

Popular posts from this blog

ORA-04062: timestamp of procedure has been changed

ORA-00939: too many arguments -when case arguments exceed 255

ORA-31655: no data or metadata objects selected for job