Skip to content
Advertisement

SQL – Adding a % sign to NVL output/result set – pictures and code included

I am having trouble adding a percent sign to the output of the NVL() function. If you look in the desired output picture you will see that the commission needs to have a % added to it. I’ve tried various things but have been unable to get it to output correctly. I have tried concatenating a percent sign but that messes up the No Commission text. Any help would be appreciated!

Here is my code:

[My Current Output] enter image description here

Desired Output enter image description here

Advertisement

Answer

You can rather use NVL2() function such as

the second argument stands for not null, and the third argument for null cases.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement