17.10 - Return Values - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - 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
kby1472250656485

The following table lists the default attributes for the result of SUM(x).

Data Type of Operand Data Type of Result Format Title
BYTEINT or SMALLINT INTEGER Default format of the INTEGER data type Sum(x)
character FLOAT Default format for FLOAT
UDT Same as the operand Format for the data type to which the UDT is implicitly cast
DECIMAL(n,m) DECIMAL(p,m), where p is determined by the rules in the following rules:
If MaxDecimal in DBSControl is 0 or 15 and
  • n  ≤  15, then p = 15.
  • 15 < n  ≤  18, p = 18.
  • n  > 18, then p = 38.
If MaxDecimal in DBSControl is 18 and
  • n  ≤  18, then p = 18.
  • n  > 18, then p = 38.

If MaxDecimal in DBSControl is 38 and n  = any value, the p = 38.

Default format for the data type of the operand Sum(x)
Other than UDT, SMALLINT, BYTEINT, DECIMAL, or character Same as the operand Default format for the data type of the operand