Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

FLOOR function - Amazon Redshift

FLOOR function

The FLOOR function rounds a number down to the next whole number.

Syntax

FLOOR(number)

Argument

number

The number or expression that evaluates to a number. It can be the SMALLINT, INTEGER, BIGINT, DECIMAL, FLOAT4, FLOAT8, or SUPER type.

Return type

FLOOR returns the same data type as its argument.

When the input is of the SUPER type, the output retains the same dynamic type as the input while the static type remains the SUPER type. When the dynamic type of SUPER isn't a number, Amazon Redshift returns NULL.

Examples

The following examples use the TICKIT sample database. For more information, see Sample database.

To show the value of the commission paid for a given sales transaction before and after using the FLOOR function, use the following example.

SELECT commission FROM sales WHERE salesid=10000; +------------+ | commission | +------------+ | 28.05 | +------------+ SELECT FLOOR(commission) FROM sales WHERE salesid=10000; +-------+ | floor | +-------+ | 28 | +-------+

Next topic:

LN

Previous topic:

EXP
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.