float data type in teradata

Database
Enthusiast

float data type in teradata

I have to do the following transformation

Round(sum(column),2)

The datatype of column is float..

Round() function is available in oracle.

--How to implement this requirement in Teradata.Should I use CAST()?

I have another query:

Suppose the column contains values like 20.123456

The target column datatype is decimal(16,2)..What will happen if I dont cast the source column..Will I get the same result as one i will get after cast as decimal(16,2).

Thanks in Advance

1 REPLY
Senior Supporter

Re: float data type in teradata

From the manual


Decimal Results and Rounding


When computing an expression, decimal results that are not exact are rounded, not truncated.


For more information on rounding rules and how the RoundHalfwayMagUp field in


DBSControl affects rounding, see “Decimal/Numeric Data Types” in SQL Data Types and


Literals and “DBS Control utility” in Utilities.


And 


"Suppose the column contains values like 20.123456


The target column datatype is decimal(16,2)..What will happen if I dont cast the source column..Will I get the same result as one i will get after cast as decimal(16,2)."


Why don't you just try?