All Forums Database
TD_DEV245 20 posts Joined 08/12
31 Aug 2012
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

''Human race acts as though comfort and luxury were the chief requirements of life, when all that we need to make us happy is something to be enthusiastic about''-Albert Einstein
ulrich 816 posts Joined 09/09
31 Aug 2012

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?

 

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

You must sign in to leave a comment.