Home > database >  Oracle NVL function doesn't work statistics don't returns 0
Oracle NVL function doesn't work statistics don't returns 0

Time:09-15

I a certain amount of data according to the primary key id 0 let it returns 0

NVL this function doesn't work this SQL what to change

CodePudding user response:

Don't work?

CodePudding user response:

What you write is full of empty returns 0

CodePudding user response:

Remove the NVL is good

CodePudding user response:

NVL function is the function of the first parameter is null, return the second parameter value, the original poster here it is not necessary to use NVL,
The select NVL (null, 'empty') from dual;
Select NVL (' is not empty, "empty") from dual;

CodePudding user response:

You NVL is inside the COUNT, the COUNT may not return empty, no data will return 0,

I understand is that problems of the building Lord XFXS three possible values, were 0100020, 0030, but now the list may not exist 0100, hope 0100 XFXSSL is 0, right,

CSDN, code with pictures, is not a good habit,

I can only say how changed,
The above code COPY out in 3, with the UNION ALL together,
Write this three code after the SELECT XFXS death, were 0100020, 0030,
Get in behind the corresponding content, to 0100020, 0030,
The final GROUP BY XFXS dispensable,
It is ok,
  • Related