FLOOR function in SQL Server
This article will show you in detail how to use the FLOOR () numerical processing function in SQL Server with specific syntax and examples to better visualize and capture functions.
Describe
The FLOOR function in SQL Server returns the lower bound value of the number or expression, ie returns the largest integer value but less than or equal to the transmitted numeric expression.
Syntax
To use the FLOOR function in SQL Server, we use the following syntax:
FLOOR(number)
Parameters :
- number: the number passed to find the largest integer value.
Note :
- See more CEILING and ROUND functions.
- The FLOOR function can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.
For example
Take a look and explore some examples of FLOOR functions in SQL Server.
SELECT FLOOR(5.9);
Result: 5
SELECT FLOOR(5);
Result: 5
SELECT FLOOR(34.29);
Result: 34
SELECT FLOOR(-5.9);
Result: -6
SELECT FLOOR(-5);
Result: -5
Previous article: COUNT function in SQL Server
Next lesson: MAX function in SQL Server
4 ★ | 1 Vote
You should read it
May be interested
- COUNT function in SQL Serverthis article will show you in detail how to use functions that handle count () numbers in sql server with specific syntax and examples to better visualize and capture functions.
- MAX function in SQL Serverthe article will explore and show you how to use the max function in sql server to find the maximum value in a set.
- MIN function in SQL Serverthe article will explore and show you how to use the min function in sql server to find the smallest value in a set.
- ROUND function in SQL Serverthe article will give you detailed instructions on how to use the sql server round () function with the syntax and specific examples to make it easier to visualize and capture the function better.
- SIGN functions in SQL Serverthe sign function in sql server is used to retrieve the sign of a number or the transmitted expression.
- SUM function in SQL Serverthe sql server sum function returns the total value of a column, a data set, or an expression.