Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Ceiling Function In Sql in SQL

Ceiling Function In Sql in SQL

? CEILING() Function in SQL

The CEILING() function returns the smallest integer greater than or equal to a specified numeric value. It is essentially the same as the CEIL() function in many SQL databases.


? Syntax

CEILING(number)
  • number: A numeric value (integer or decimal).

  • Returns an integer value.


? Examples

1. Basic usage

SELECT CEILING(4.3);-- Returns 5

2. When the number is already an integer

SELECT CEILING(7);-- Returns 7

3. Negative numbers

SELECT CEILING(-3.7);-- Returns -3

? Notes

  • CEILING() rounds up to the nearest integer.

  • Supported by most SQL databases: MySQL, SQL Server, PostgreSQL, Oracle.

  • Equivalent to CEIL() in databases that support that function.


Want to see the FLOOR() function for rounding down or examples combining these with other math functions?

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql