ABS is short name of ABSOLUTE. When we use it, it shows the absolute value of the number.
When output comes in a negetive integer, it converts it in possitive integer by multiplying it by -1.
Let's have an example:-
SELECT ABS(50);
--> 50
SELECT ABS(50.50);
--> 50.5
SELECT ABS(-50);
--> 50
SELECT ABS(-50.50);
--> 50.5
SELECT ABS(-50*10);
--> 500
SELECT ABS(50*10);
--> 500
When output comes in a negetive integer, it converts it in possitive integer by multiplying it by -1.
Let's have an example:-
SELECT ABS(50);
--> 50
SELECT ABS(50.50);
--> 50.5
SELECT ABS(-50);
--> 50
SELECT ABS(-50.50);
--> 50.5
SELECT ABS(-50*10);
--> 500
SELECT ABS(50*10);
--> 500
Read Also:- ABS function in Greenplum
No comments:
Post a Comment