FLOOR
The FLOOR
function returns the largest integer equal to or less than Expression
.
SQL syntax
FLOOR (Expression)
Parameters
FLOOR
has the parameter:
Parameter | Description |
---|---|
|
Operand or column can be any numeric data type. |
Description
-
If
Expression
is of typeNUMBER
, the data type returned isNUMBER
with maximum precision and scale. Otherwise,FLOOR
returns the same data type as the numeric data type ofExpression
. -
If the value of
Expression
isNULL
,NULL
is returned. If the value ofExpression
is-INF
,INF
, orNaN
, the value returned is-INF
,INF
, orNaN
respectively.
Examples
Sum the commission_pct
for employees in the employees
table. Then call FLOOR
to return the largest integer equal to or less than the value returned by SUM
. You see the value returned by the SUM
function is 7.8
and the value returned by the FLOOR
function is 7:
Command> SELECT SUM (commission_pct) FROM employees; < 7.8 > 1 row found. Command> SELECT FLOOR (SUM (commission_pct)) FROM employees; < 7 > 1 row found.