ABS function in SQL Server
This article will show you in detail how to use the ABS () handling function in SQL Server with specific syntax and examples to better visualize and capture functions.
This article will show you in detail how to use the ABS () handling function in SQL Server with specific syntax and examples to better visualize and capture functions.
Describe
The ABS function in SQL Server returns the absolute value of a number.
Syntax
To use the ABS function in SQL Server, we use the following syntax:
ABS(number)
Parameters :
- number: the number you want to change to the absolute value.
Note :
- The ABS function can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.
For example
Take a look and explore some examples of ABS functions in SQL Server.
SELECT ABS(-24);
Result: 24
SELECT ABS(-24.6);
Result: 24.6
SELECT ABS(-24.65);
Result: 24.65
SELECT ABS(24.65 * -1);
Result: 24.65
Previous post: UPPER function in SQL Server
Next article: Function AVG in SQL Server
Update 25 May 2019
You should read it
- DAY function in SQL Server
- MIN function in SQL Server
- MAX function in SQL Server
- SUM function in SQL Server
- AVG function in SQL Server
- DATEPART function in SQL Server
- ROUND function in SQL Server
- DATENAME function in SQL Server
- MONTH function in SQL Server
- GETUTCDATE function in SQL Server
- FLOOR function in SQL Server
- SQL Server YEAR function
Maybe you are interested
We may be able to see the 'second moon' in the sky with the naked eye next May The most bizarre things people ever bring to space Will the Earth be affected if the comet once destroyed the dinosaurs hitting the Sun? 'Wow!' - Has the mysterious cosmic signal of 'alien' been decoded? True moon, snow moon and comet will appear together today The 7 largest objects people ever launched into space