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 0CodePudding user response:
Remove the NVL is goodCodePudding 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,