ORA-24347: NULL column warning in aggregate function

I get this warning:

ORA-24347: Warning of a NULL column in an aggregate function 

when using the Oracle MAX() function in production. I am using the OCI library to connect to Oracle, version 11.2.0.2.

But on the test server this error does not occur. I programmed the request so that a NULL value could be passed to the aggregate function. I still could not reproduce this problem.

Is this warning related to any Oracle error? Can someone provide an example request that will trigger this warning?

Edit:

 Table: EX_TABLE Columns: ID NOT NULL NUMBER SOME_NUMBER NUMBER MAX_VAL NUMBER 

Query:

 select MAX(DECODE(some_number,1,max_val,NULL)) val1 , MAX(DECODE(some_number,2,max_val,NULL)) val2 , MAX(DECODE(some_number,3,max_val,NULL)) val3 from EX_TABLE 
+4
source share
1 answer

You must decode the values ​​with 0, not with NULL;

 select MAX(DECODE(some_number,1,max_val,0)) val1, MAX(DECODE(some_numer,2,max_val,0)) val2, MAX(DECODE(some_numer,3,max_val,0)) val3 from EX_TABLE 
0
source

All Articles