TOP m PERCENT and Rounding - Teradata Vantage - Analytics Database

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

If (m*COUNT(*)/100.0) does not evaluate to an integer value, then Vantage rounds it up to the next highest integer value; otherwise, the intended result is not achieved. The following table shows how rounding occurs:

IF (m*COUNT(*)/100.0) evaluates to this value … THEN the system rounds it up to this value …
0.1                                          1
9.2                                        10

Vantage only applies this rounding up to the first 15 digits following the decimal point. For example, if (m*COUNT(*)/100.0) evaluates to 0.0000000000000001, or 1 x 10-16, then the system does not round it up to 1.