Home > database >  The strange problems when using the NVL, comment, online, etc. ~
The strange problems when using the NVL, comment, online, etc. ~

Time:10-04

As is shown in

The query is less than 16 rpp11-1230 & gt; 01 the contract no.,
After two SQL can return 0, but the first sentence SQL returns is NULL,
Check along while information also didn't understand what's going on,
Please help to look at,
PS
Index: under the rebuilt before the create index idx_cy_batch_no on cy_coildata (cy_batch_no, 0),
Will be related to this,

CodePudding user response:

Is quite good strange,

NVL (sum (), 0), the affirmation is 0, have nothing to do with this index;

You is to see the program NULL, or seen in PLSQL NULL?

CodePudding user response:

reference 1st floor wmxcn2000 response:
is good strange,

NVL (sum (), 0), the affirmation is 0, have nothing to do with this index;

You is to see the program NULL, or seen in PLSQL NULL?


This is my a function of SQL, single step debugging, monitoring list is NULL

CodePudding user response:

Returns the number of records is 0 because of you, will give you show a Null in the monitoring

CodePudding user response:

Because there is no record, shows the empty record, and not have the result, the result is empty, this is the two concepts,
You to count test, display is zero,

CodePudding user response:

There is no record is 0

SQL> Select sum (comm) from emp where empno=7369;

The SUM (COMM)
-- -- -- -- -- -- -- -- -- --


SQL> The select NVL (sum (comm), 0) from emp where empno=7369;

NVL (SUM (COMM), 0)
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0

SQL> Select * from emp where empno=7368;

Not selected row

SQL> The select NVL (sum (comm), 0) from emp where empno=7368;

NVL (SUM (COMM), 0)
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0

CodePudding user response:

If is empty, the first to try this
 NVL (sum (cy_coil_weight_act)/1000, 0)