ABS Function [Numeric]

Returns the absolute value of a numeric expression.

Syntax

ABSnumeric-expression )

Parameters

Parameter

Description

numeric-expression

The number whose absolute value is to be returned.

Returns

An absolute value of the numeric expression.

Numeric-expression Data Type Returns
INT INT
FLOAT FLOAT
DOUBLE DOUBLE
NUMERIC NUMERIC

Example

The following statement returns the value 66:

SELECT ABS( -66 ) FROM iq_dummy

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Compatible with Adaptive Server Enterprise.