CEILING function in SQL Server
This article will show you in detail how to use the SQL Server CEILING () function with the syntax and specific examples to make it easier to visualize and capture functions.
Describe
The CEILING function in SQL Server returns the upper bound value of the number or expression, ie returns the smallest integer value but greater than or equal to the transmitted numeric expression.
Syntax
To use the CEILING function in SQL Server, we use the following syntax:
CEILING(number)
Parameters :
- number: the number passed to find the smallest integer value.
Note :
- See also FLOOR and ROUND functions.
- The CEILING 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
See and explore some examples of CEILING functions in SQL Server.
SELECT CEILING(32.65);
Result: 33
SELECT CEILING(32.1);
Result: 33
SELECT CEILING(32);
Result: 32
SELECT CEILING(-32.65);
Result: -32
SELECT CEILING(-32);
Result: -32
Previous article: Function AVG in SQL Server
Next lesson: COUNT function in SQL Server
4.3 ★ | 4 Vote
You should read it
May be interested
- DATEPART function in SQL Serverthe datepart function in sql server returns a time value of the input argument, which can be day, month, year, quarter, hour, minute, second, millisecond ... the return value is an integer type (int)
- DATENAME function in SQL Serverthe datename function in sql server returns a time value of the input argument, which can be day, month, year, quarter, hour, minute, second, millisecond ... the return value is a string type (ascii)
- Should decorative ceiling fans be used?are ceiling fans cool? the following article will delve into this product line and help you answer the question of whether to use a ceiling fan with decorative lights.
- Panasonic ceiling fan models can not be ignored for modern style housingdo not ignore the suggestions of panasonic modern ceiling fans if you want your housing space to be youthful and comfortable!
- 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.
- RIGHT function in SQL Serverthe article will explore and guide you how to use the right function in sql server to extract some characters from the right side of a given string.
- FLOOR function in SQL Serverthe floor function in sql server returns the largest integer value but less than or equal to the transmitted numeric expression.
- MONTH function in SQL Serverthis article will show you in detail how to use the datetime month () processing function in sql server with specific syntax and examples to better visualize and capture functions.
- DATEDIFF function in SQL Serverthis article will show you in detail how to use sql server's datetime datediff () function with syntax and specific examples to make it easier to visualize and capture functions.
- GETUTCDATE function in SQL Serverthis article will show you in detail how to use datetime getutcdate () function in sql server with specific syntax and examples to better visualize and capture functions.