Numeric Functions in SQL
Numeric Functions in SQL
Mathematical Functions
ABS: Returns the absolute value of ‘n’
ROUND(n[,m])
Select ROUND (15.19,1) “Round” from dual;
SQRT: Returns square root of n.
SQRT(n)
EXTRACT(MONTHFROMSYSDATE)
-------------------------
9
GREATEST: Returns the greatest value in the list of expressions.
GREATEST(expr1, expr2….exprn)
GREATEST(4,5,17)
----------------
17
G
-
5
LEAST: Returns the least value in the list of expressions.
MOD(m,n)
TRUNC(n[,decimal places])
Select TRUNC(125.815,1) from dual;
FLOOR: Returns the largest integer value that is equal to or less than a number.
CEIL: Returns the smallest integer value that is greater than a number.