Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

SQL ABS Function

The ABS function returns the absolute value of a number.

ABS changes all numbers to positive values.

ABS has no effect on zero values.

Example

#

This example returns the absolute values for the input numbers.

SELECT ABS(-15.6) AS '-15.6',
       ABS(0.4) AS '0.4',
       ABS(-8.91) AS '-8.91'
Result:  1 record
-15.6 0.4 -8.91
15.6 0.4 8.91

Syntax

Syntax of the ABS function.

ABS(number)

number -- a number to convert to an absolute value.


You may also like



Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

Guides


vsn 3.1