Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

Oracle ABS() function

Description

The ABS() function is used to calculate the absolute value of an expression.

The function takes any numeric or nonnumeric data type (can be implicitly converted to a numeric data type) as an argument.
The function returns the same data type as the numeric data type of the argument.

Syntax:

 ABS(N); 

Parameters:

Name Description
N A number whose absolute value is to be retrieved.

Pictorial Presentation of ABS() function

Pictorial Presentation of Oracle ABS() function

Example: ABS() function using positive value

The example below shows that, the oracle statement will return the absolute value of a positive number specified in the argument.

SELECT ABS(5) FROM dual;

Here is the result.

    ABS(5)
----------
         5

Example: ABS() function using negative value

The example below shows that, the oracle statement will return the absolute value of a negative number defined in the argument.

SELECT ABS(-5) FROM dual;

Here is the output.

    ABS(5)
----------
         5

Previous: Oracle Numeric Functions Introduction
Next: ACOS