Oracle PL/SQL – FLOOR function example

The FLOOR() function round the specified number down, and return the largest number that is less than or equal to the specified number.

FLOOR function examples


SELECT FLOOR(1.2) FROM DUAL; 		-- output : 1

SELECT FLOOR(1.5) FROM DUAL; 		-- output : 1

SELECT FLOOR(1.7) FROM DUAL; 		-- output : 1

SELECT FLOOR(1.99) FROM DUAL;		-- output : 1

SELECT FLOOR(-1.2) FROM DUAL; 		-- output : -2

SELECT FLOOR(-1.5) FROM DUAL; 		-- output : -2

SELECT FLOOR(-1.7) FROM DUAL; 		-- output : -2

SELECT FLOOR(-1.99) FROM DUAL; 		-- output : -2

SELECT FLOOR(20.9) FROM DUAL; 		-- output : 20

SELECT FLOOR(-5.1) FROM DUAL; 		-- output : -6

SELECT FLOOR(-100.01) FROM DUAL;	-- output : -101

SELECT FLOOR(1000.99) FROM DUAL;	-- output : 1000

References

  1. FLOOR Function :- Oracle official docs

About the Author

author image
Dhaval Dadhaniya
Dhaval Dadhaniya is a software engineer by profession and reader/writter by passion. He is working in a well reputed MNC as an applications Developer with 5 years of experience. He have good understanding and knowledge of Java, Database, Spring, Hibernate and exploring other technologies related to Software development. Befriend him on Facebook

Comments

avatar