Oracle / PLSQL: ABS Function

This article is written about how to use the Oracle/PLSQL ABS function with syntax and examples.

Description

The Oracle/PLSQL ABS function returns the absolute value of a number.

Syntax

The syntax for the ABS function in Oracle/PLSQL is:

ABS( number )

Parameters or Arguments

number

The number to convert to an absolute value.

Returns

The ABS function returns a numeric value.

Applies To

The ABS function can be used in the following versions of Oracle/PLSQL:

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Example

Let’s look at some Oracle ABS function examples and explore how to use the ABS function in Oracle/PLSQL.

For example:

ABS(-23)
Result: 23

ABS(-23.6)
Result: 23.6

ABS(-23.65)
Result: 23.65

ABS(23.65)
Result: 23.65

ABS(23.65 * -1)
Result: 23.65