HomeНаука и техникаRelated VideosMore From: Database Star

Oracle FLOOR Function

5 ratings | 549 views
https://www.databasestar.com/oracle-ceil/ The Oracle FLOOR function will return the largest integer value less than the specified number. In other words, it rounds down to the nearest whole number. It’s the opposite of the CEIL function, which rounds up. The syntax of FLOOR is: FLOOR(number) The number parameter can be any numeric data type. The function will return a number in the same data type as the parameter. So, you can use FLOOR with decimal numbers, which is actually where FLOOR works best. You can use it with whole numbers too. It won’t show an error, it just might display the same value as provided (e.g. FLOOR(5) would be 5). You can also use functions inside FLOOR. For example, FLOOR(SUM(salary)) will SUM all of the salary values, and then round them down to the nearest whole number. Just like with all functions, the Oracle FLOOR function can also use column aliases. So, instead of having your column labelled “FLOOR(8.12)” or “FLOOR(salary)”, you can label your column “salary_rounded” or something that makes more sense. The FLOOR function is similar to the ROUND function. However, ROUND will round up or down, where FLOOR will always round down. The TRUNC function will also do some kind of rounding, but it removes decimals from a number which may cause it to “round” down. For more information, including the code used in the examples, read the related article here: https://www.databasestar.com/oracle-ceil/
Html code for embedding videos on your blog
Text Comments (0)

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.