w3resource

PostgreSQL FLOOR() function

FLOOR() function

The PostgreSQL floor() function is used to return the value after rounded up any positive or negative decimal value as smaller than the argument.

Syntax:

floor()

PostgreSQL Version: 9.3

Pictorial presentation of FLOOR() Function

postgresql floor function

Pictorial presentation of PostgreSQL FLOOR() function

pictorial presentation of PostgreSQL FLOOR() function

Example: PostgreSQL FLOOR() function

Code:

SELECT FLOOR(53.6) AS "Floor";

Sample Output:

 Floor
-------
    53
(1 row)

Example: PostgreSQL FLOOR() function using negative value

Code:

SELECT FLOOR(-53.6) AS "Floor";

Sample Output:

 Floor
-------
   -54
(1 row)

Previous: EXP function
Next: LN function



Share this Tutorial / Exercise on : Facebook and Twitter