# Source: https://docs.oxla.com/sql-reference/sql-functions/math-functions/floor.md

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oxla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FLOOR

## Overview

The `FLOOR()` returns a number rounded down that is less than or equal to the specified argument.&#x20;

## Syntax

The syntax for the `FLOOR()` function in Oxla is:

```sql  theme={null}
FLOOR(x)
```

The `FLOOR()` function requires one argument:

`x`: A positive or a negative decimal number (or an expression that evaluates to a decimal number).

## Examples

### Case #1: Rounding Down a Positive Decimal Value

The following example demonstrates how the `FLOORL()` function rounds down a positive decimal value:

```sql  theme={null}
SELECT FLOOR(345.6765467);
```

It will return 345 as it is the closest value smaller than the argument.

```sql  theme={null}
+------+
| f    |
+------+
| 345  |
+------+
```

### Case #2: Rounding Down a Negative Decimal Value

The following example demonstrates how the `FLOORL()` function rounds down a negative decimal value:

```sql  theme={null}
SELECT FLOOR(-0.987657);
```

You will get the following result as it is the nearest integer smaller than or equal to the specified argument.

```sql  theme={null}
+-------+
| f     |
+-------+
| -1    |
+-------+
```

### Case #3: Using the FLOOR() Function With a Table

The following example demonstrates how the `FLOOR()` function can be used with a table to round down the values in a specific column:

1. Create a new table called **FloorRecords** with double-precision values using the query below:

```sql  theme={null}
CREATE TABLE FloorRecords (numbers float);
INSERT INTO FloorRecords VALUES (3.987), (4.325), (-0.76), (-22.57);
```

2. Retrieve the table with its value by running the following query:

```sql  theme={null}
SELECT * ,FLOOR(numbers) AS Floorvalue FROM FloorRecords;
```

3. The return table will contain the following:

* **numbers,** the column with the initial double-precision values.
* **FloorValue**, the column with the rounded-down values. 

```sql  theme={null}
+------------+---------------+
| numbers    | Floorvalue    |
+------------+---------------+
| 3.987	     | 3             |
| 4.325	     | 4             |
| -0.76	     | -1            |
| -22.57     | -23           |
+------------+---------------+
```