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:-
SQL> SELECT ABS(10) ABS_VALUE FROM DUAL;
ABS_VALUE
----------
10
SQL> SELECT ABS(10.10) ABS_VALUE FROM DUAL;
ABS_VALUE
----------
10.1
SQL> SELECT ABS(-10) ABS_VALUE FROM DUAL;
ABS_VALUE
----------
10
SQL> SELECT ABS(-10.10) ABS_VALUE FROM DUAL;
ABS_VALUE
----------
10.1
SQL> SELECT ABS(-10*10) ABS_VALUE FROM DUAL;
ABS_VALUE
----------
100
SQL> SELECT ABS(10*10) ABS_VALUE FROM DUAL;
ABS_VALUE
----------
100
Read Also:- ABS function in SQL
No comments:
Post a Comment