FLOOR Function Examples | Teradata Vantage - Examples: Using the FLOOR Function - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageā„¢

Example: Querying SELECT FLOOR (136E-1);

The following query returns the FLOAT value 13E0, since 13 is the largest integer that is less than the FLOAT value 13.6E0.

   SELECT FLOOR (136E-1);

Example: Querying SELECT FLOOR(-6.5);

The following query returns a DECIMAL value of -7.0 since -7 is the largest integer that is less than the DECIMAL literal -6.5.

   SELECT FLOOR(-6.5);

Example: Querying SELECT FLOOR (CAST(-6.5 AS DECIMAL(2,1)));

The following query returns a value of -7.0 with a data type of DECIMAL(3,1), since -7 is the largest integer less than DECIMAL -6.5. Note that the precision of the return value is increased by 1.

   SELECT FLOOR (CAST(-6.5 AS DECIMAL(2,1)));