ORACLE ABS FUNCTION
Oracle ABS function will always return the +ve number value. Below are the examples
ORACLE CEIL & FLOOR FUNCTION
Oracle CEIL function will always work with +ve numbers & return +1 before the decimal. It will not work if either there is no decimal value OR the value in -ve number.
BUT
Oracle FLOOR function will always work with -ve numbers & return +1 before the decimal. It will not work if either there is no decimal value OR the value in +ve number.
--- CEIL EXAMPLES ---
---FLOOR EXAMPLES ---
ORACLE ROUND FUNCTION
Oracle ROUND function always work on decimal values & takes two arguments, first is the values which we need to do Round & second is the limit up to what place we need to do Round.
1. Round takes default ZERO limit if the limit is not mentioned
2. If Round value is in +VE form then the round count will start from the RIGHT of the decimal digit
3. Round check the +1 digit from the mentioned limit, for example if we have 2 limits to take ROUND(1234.3756,2) then round will check the 2+1 i.e. 3rd digit
number(5). If 3rd digit number is GREATER or EQUAL to 5 then it will round the 2nd digit number So the output will be 1234..38
5. If Round limit is not existing then it will not do any round action. for example if we have 3 limits of round ROUND(1234.37) then It will not do any action
because the 3rd limit digit is not present.
6. If Round value is in -VE form then the round count will start from the LEFT of the decimal digit
7. If Round value is -VE then Round will put ZERO up to the limit mentioned from the LEFT of the decimal digit & eliminate all decimal values, for example if
we have -3 limits in ROUND(1234.3456,-3) then it will take the count from the LEFT & put ZERO up to the limit & eliminate decimals. So the output will be
1000
8. If Round values in -VE the limit is not existing then it will put overall ZERO as output. for example if we have -3 limits in ROUND(12.567,-3) then it will take
the count from the LEFT & check the -3 digits, Here -3rd digit is not present so it will put ZERO as output
-- ROUND EXAMPLES --
ORACLE TRUNC FUNTION
Oracle TRUNC funtion is always used to trucate the digits up to the mentioned limits.
1. If number is +ve then truncate will take the digits up to the mentioned limit RIGHT from the decimal (It will not rounding the values like Round function )
2. If number is -ve then truncate will take the digits up to the mentioned limit LEFT from the decimal & put ZERO + eliminate all the decimal digits (It will not
rounding the values like Round function)
NOTE: IF YOU HAVE DOUBTS, KINDLY CONTACT ME VIA THIS BLOG
Oracle ABS function will always return the +ve number value. Below are the examples
ORACLE CEIL & FLOOR FUNCTION
Oracle CEIL function will always work with +ve numbers & return +1 before the decimal. It will not work if either there is no decimal value OR the value in -ve number.
BUT
Oracle FLOOR function will always work with -ve numbers & return +1 before the decimal. It will not work if either there is no decimal value OR the value in +ve number.
--- CEIL EXAMPLES ---
---FLOOR EXAMPLES ---
ORACLE ROUND FUNCTION
Oracle ROUND function always work on decimal values & takes two arguments, first is the values which we need to do Round & second is the limit up to what place we need to do Round.
1. Round takes default ZERO limit if the limit is not mentioned
2. If Round value is in +VE form then the round count will start from the RIGHT of the decimal digit
3. Round check the +1 digit from the mentioned limit, for example if we have 2 limits to take ROUND(1234.3756,2) then round will check the 2+1 i.e. 3rd digit
number(5). If 3rd digit number is GREATER or EQUAL to 5 then it will round the 2nd digit number So the output will be 1234..38
5. If Round limit is not existing then it will not do any round action. for example if we have 3 limits of round ROUND(1234.37) then It will not do any action
because the 3rd limit digit is not present.
6. If Round value is in -VE form then the round count will start from the LEFT of the decimal digit
7. If Round value is -VE then Round will put ZERO up to the limit mentioned from the LEFT of the decimal digit & eliminate all decimal values, for example if
we have -3 limits in ROUND(1234.3456,-3) then it will take the count from the LEFT & put ZERO up to the limit & eliminate decimals. So the output will be
1000
8. If Round values in -VE the limit is not existing then it will put overall ZERO as output. for example if we have -3 limits in ROUND(12.567,-3) then it will take
the count from the LEFT & check the -3 digits, Here -3rd digit is not present so it will put ZERO as output
-- ROUND EXAMPLES --
ORACLE TRUNC FUNTION
Oracle TRUNC funtion is always used to trucate the digits up to the mentioned limits.
1. If number is +ve then truncate will take the digits up to the mentioned limit RIGHT from the decimal (It will not rounding the values like Round function )
2. If number is -ve then truncate will take the digits up to the mentioned limit LEFT from the decimal & put ZERO + eliminate all the decimal digits (It will not
rounding the values like Round function)
NOTE: IF YOU HAVE DOUBTS, KINDLY CONTACT ME VIA THIS BLOG
No comments:
Post a Comment