Oracle [Procedure] - Sum function ignores WHERE clause
问题 I have a problem with a ORACLE Procedure, it seems that SELECT SUM ignores my WHERE clause, and Sums up ALL of the columns instead of only those that i want to (deptno). However if i use one of this functions like this for example : select SUM(SAL) AS SALSUM FROM SCOTT.EMP WHERE SCOTT.EMP.DEPTNO = 10; It displays the proper SUM. What may be the problem? Thanks for help. CREATE OR REPLACE PROCEDURE PROCEDURE1(numerdept IN number, money OUT number) IS SALSUM NUMBER; COMMSUM NUMBER; WYJATEK