ABS
7min
This article will show you how to calculate the absolute value using the ABS() function.
Overview
The ABS() function returns the absolute value of a number.
The input and return types we support can be seen in the table below.

✅ The ABS() function returns a value that is the same as the input types.
Examples
#Case 1: Basic Absolute
The following example will calculate the absolute value of a negative floating number:
Select abs
|
It will return the floating number without the negative value:
Output
|
#Case 2: Absolute with an expression
The following example calculates the absolute value of an expression i.e., the subtraction operation:
Select abs
|
We know that the result of (150 - 250) is -100, but in this case, we’re using an ABS() function to get an absolute number so that the result will ignore the negative value.
Output
|