Difference between revisions of "NUMERIC BUILT IN FUNCTIONS"
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
GREATEST(9,67.6,10)67.6 | GREATEST(9,67.6,10)67.6 | ||
<h2> converting numbers to character </h2> | |||
SELECT TO_CHAR(SALARY, '$99,999') AS "SALARY" | |||
FROM EMPLOYEES | |||
RESULT -> $24,000 | |||
TO_CHAR(3000, '$999999.99') -> $3000.00 | |||
TO_CHAR(4500, '$99,999') -> $4,500 | |||
TO_CHAR(9000, '$99,999.99') -> $9,000.00 | |||
TO_CHAR(4422, '$0009999') -> $0004422 | |||
[[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]] | [[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]] |
Latest revision as of 18:51, 19 November 2017
ROUND()
THE , 2 AT THE END IS NUMBER OF PLACES TO ROUND
ROUND(49.113212,2) = 49.11
CEIL()
Integer value that is greater than or equal to the number
CEIL(48.99)=49
POWER()
POWER(4,2)=16
SQRT()
SQRT(16)=4
GREATEST()
Returns the largest of multiple value
GREATEST(9,67.6,10)67.6
converting numbers to character
SELECT TO_CHAR(SALARY, '$99,999') AS "SALARY" FROM EMPLOYEES RESULT -> $24,000
TO_CHAR(3000, '$999999.99') -> $3000.00 TO_CHAR(4500, '$99,999') -> $4,500 TO_CHAR(9000, '$99,999.99') -> $9,000.00 TO_CHAR(4422, '$0009999') -> $0004422