FLOOR()

Documentation

VoltDB Home » Documentation » Using VoltDB

FLOOR()

FLOOR() — Returns the largest integer value less than or equal to a numeric expression.

Synopsis

FLOOR( numeric-expression )

Description

The FLOOR() function returns the largest integer less then or equal to the specified numeric expression. In other words, the FLOOR() function truncates fractional numeric values. For example:

FLOOR(3.1415) = 3
FLOOR(2.0) = 2
FLOOR(-5.32) = -6

Example

The following example uses the FLOOR function to calculate the whole number of stocks owned by a specific shareholder.

SELECT customer, company, 
       FLOOR(num_of_stocks) AS stocks_available_for_sale
       FROM shareholders WHERE customer_id = ?
       ORDER BY company;