16.20 - Examples - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2020-03-25
dita:mapPath
xzf1512079057909.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
kby1472250656485

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)) );