Please find below POST about Oracle SINGLE ROW FUNCTIONS which might be useful.
SINGLE ROW FUNCTION are those which are executed once for each and every row of the Query.
The different types of SINGLE ROW FUNCTIONS are:
1. NUMBER Functions
2. DATE Functions
3. CHARACTER Functions
4. CONVERSION Functions
5. GENERAL Functions
Let us categorize some of the SINGLE ROW FUNCTIONS and its usage:
NUMBER Functions:
ROUND(m,[n]) - Round the number m to n decimal places (n is optional)
Expand|Select|Wrap|Line Numbers
- SELECT ROUND(2.555,2) FROM dual -- returns 2.56
Expand|Select|Wrap|Line Numbers
- DECLARE
- a NUMBER;
- BEGIN
- a:= ROUND(2.555,2);
- END;
Expand|Select|Wrap|Line Numbers
- SELECT TRUNC(2.555,2) FROM dual -- returns 2.55
Expand|Select|Wrap|Line Numbers
- SELECT MOD(3,1) FROM dual -- returns 0
Expand|Select|Wrap|Line Numbers
- SELECT CEIL(1.5) FROM dual -- smallest integer larger than 1.5 is 2 so this query returns 2
Expand|Select|Wrap|Line Numbers
- SELECT FLOOR(1.5) FROM dual -- largest integer smaller than 1.5 is 1 so this query returns 1
Expand|Select|Wrap|Line Numbers
- SELECT SIGN(-235) FROM dual -- returns -1
- SELECT SIGN(235) FROM dual -- returns 1
Expand|Select|Wrap|Line Numbers
- SELECT POWER(2,2) FROM dual -- returns 4