Skip to content
SQLSimplified
numeric

FLOOR()

Rounds a number down to the nearest integer (floor).

Description

FLOOR rounds a number down to the largest integer less than or equal to it. Use it when you need to "round down" — for example, whole units you can ship when partial units aren't allowed.

Syntax

FLOOR(expression)

Parameters

NameDescriptionOptional
expressionA numeric column or expression.No

Return Type

Returns an integer type. The fractional part is discarded by rounding downward.

Examples

Store (Customers/Orders/Products)

Loading database engine...

Store (Customers/Orders/Products)

Loading database engine...

FLOOR vs CEIL

FLOOR always moves down (toward negative infinity); CEIL always moves up. FLOOR(-2.3) is -3.

Common Mistakes

  • Confusing with rounding. FLOOR always goes down; use ROUND for nearest.
  • Negative numbers. FLOOR(-2.3) is -3, not -2.
  • Expecting decimals. The result is an integer.

See also: CEIL, ROUND.

Search

Search lessons, functions, examples, and practice problems