Q
Problem solve Get help with specific problems with your technologies, process and projects.

Use of decimal in NVL function

I would like to ask about the NVL function. Is there any difference between these?

I would like to ask about the NVL function.

Which is better:

    select nvl(col1,0)
    from ...;

or

    select nvl(col1,0.0)
    from ...;

if col1's type is number.

I would like to know if there is any difference between them.

The only difference is in the format of the literal--if you want a decimal point in your result, then use the second form. The values are the same and there should be no difference in performance, since in the case of a null value Oracle just returns the literal that you've specified.

Dig Deeper on Oracle database performance problems and tuning

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close