CEIL

From SQLZOO
Revision as of 09:51, 1 October 2012 by Peter (Talk | contribs)

Jump to: navigation, search
Compatibility
CEIL(f)
EngineOKAlternative
ingresYes
mysqlYes
oracleYes
postgresYes
sqlserverNoFLOOR(-f)

CEIL

CEIL(f) is ceiling, it returns the integer that is equal to or just more than f

CEIL(f) give the integer that is equal to, or just higher than f. CEIL always rounds up.

 CEIL(2.7)  ->  2
 CEIL(-2.7) -> -3

In this example we calculate the population in millions.

 
SELECT population/1000000 AS a,
       FLOOR(population/1000000) AS b
  FROM bbc
SELECT population/1000000 AS a,
       CEIL(population/1000000) AS b
  FROM bbc

See also

Language: English  • Deutsch
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense