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.

Ceil Function In Sql in SQL

Ceil Function In Sql in SQL

? CEIL() Function in SQL

The CEIL() function returns the smallest integer greater than or equal to a given number. It's also called CEILING() in some databases.


? Syntax

CEIL(number)

or

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

  • Returns an integer.


? Examples

1. Basic usage

SELECT CEIL(4.2);-- Returns 5

2. When the number is already an integer

SELECT CEIL(7);-- Returns 7

3. Negative numbers

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

? Notes

  • Useful for rounding up decimals to the nearest integer.

  • Available in most SQL databases: MySQL, PostgreSQL, SQL Server (CEILING()), Oracle.


Want me to show you the opposite function like FLOOR()?

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