17.10 - Rules - 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 rules apply to WIDTH_BUCKET:
  • If any argument is null, then the result is also null.
  • If partition_count <=0 or if partition_count > 2147483646, an error is returned to the requestor.
  • If lower_bound = upper_bound, an error is returned to the requestor.
  • If lower_bound < upper_bound, then the rules in the following table apply.
IF … THEN the result is …
value_expression < lower_bound 0.
value_expression >= upper_bound partition_count +1.

If the result cannot be represented by the data type specified for the result, then an error is returned.

anything else the greatest exact numeric value with scale 0 that is less than or equal to the following expression.


  • If lower_bound > upper_bound, then the rules in the following table apply.
IF … THEN the result is …
value_expression > lower_bound 0.
value_expression <= upper_bound partition_count +1.

If the result cannot be represented by the data type specified for the result, then an error is returned.

anything else the least exact numeric value with scale 0 that is less than or equal to the following expression.