Answers ( 2 )

  1. The NVL() function lets you return an alternative value when an expression iS NULL.
    The syntax is NVL(expr1,expr2).
    Example:
    SELECT ProductName, UnitPrice * (UnitsInStock + NVL(UnitsOnOrder, 0))
    FROM Products;

    The above query will return 0 when UnitsOnOrder is NULL.

    .

  2. The NVL function allows you to replace null values with a default value. If the value in the first parameter is null, the function returns the value in the second parameter.

    e.g- select id, nvl(col_1, 0)

    Whenever the col_1 is null, it will return its value as 0

Leave an answer

Browse
Browse