db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "有你就不孤单" <87928...@qq.com>
Subject can't get warning 01003 in nested select in update
Date Fri, 15 May 2015 09:11:18 GMT
hi, 

Below is the SQL details in derby ij:

1, list the column salary is null record.
ij(CONNECTION1)> select empno, salary from emp where salary is null;
EMPNO |SALARY
-----------------
001188|NULL
000010|NULL

2 rows selected

2, when run select with function avg lonely, can get the warning.
ij(CONNECTION1)> SELECT AVG ( T2 . SALARY ) FROM APP.EMP T2;
1
----------------
28363.2926
WARNING 01003: Null values were eliminated from the argument of a column functio
n.

1 row selected

3, when the select in an update statement, can't get the warning 01003.
ij(CONNECTION1)> UPDATE APP.EMP T1 SET SALARY = ( SELECT AVG ( T2 . SALARY ) FRO
M APP.EMP T2 ) WHERE WORKDEPT = 'D21' AND SALARY < ( SELECT AVG ( T3 . SALARY )
FROM APP.EMP T3 );
7 rows inserted/updated/deleted
ij(CONNECTION1)>

And I also tried JDBC call derby, also the pure select can get the warning, the update one
also can't get the warning message, do you think this is a defect? Thanks for your help :).
Mime
View raw message