Can anyone see anything wrong with this statement?
CREATE OR REPLACE VIEW V_DEPT_AMOUNT AS
SELECT DEPTNO AS DNO, DNAME AS DNAME, MAX(AMOUNT) AS MAX_AMOUNT,
AVG(AMOUNT) AS AVG_AMOUNT, MIN(AMOUNT) AS MIN_AMOUNT,
SUM(AMOUNT) AS TOTAL_AMOUNT FROM DEPT D, EMP E, PURCHASE P
WHERE D.DEPTNO = E.DEPTNO
GROUP BY DNAME, DEPTNO;
It is meant to list names and numbers of all company departments together with the maximum, minimum, average and total amount contributed by each department.
The error I am getting is that "column ambiguously defined"