CEILING Function Examples | Teradata Vantage - Examples - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢

Example: Querying SELECT CEILING(157E-1);

The following query returns the FLOAT value 16E0, since 16 is the smallest integer that is not less than the FLOAT value 15.7E0.

SELECT CEILING(157E-1);

Example: Querying SELECT CEILING(15.7);

The following query returns a DECIMAL value of 16.0 since 16 is the smallest integer that is not less than the DECIMAL literal 15.7.

SELECT CEILING(15.7);

Example: Querying SELECT CEILING(-12.3);

The following query returns a DECIMAL value of -12.0 since -12 is the smallest integer that is not less than the DECIMAL literal -12.3.

SELECT CEILING(-12.3);

Example: Querying SELECT CEIL( CAST(9.99 AS DECIMAL(3,2)) );

The following query returns the value 10.00 with a data type of DECIMAL(4,2), since 10 is the smallest integer that is not less than 9.99. Note that the precision of the return value is increased by 1.

SELECT CEIL( CAST(9.99 AS DECIMAL(3,2)) );