WIDTH BUCKET Function Syntax | Teradata Vantage - 17.10 - WIDTH BUCKET Function Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1145-171K
Language
English (United States)
WIDTH BUCKET (value_expression, lower_bound, upper_bound, partition_count)

Syntax Elements

value_expression
The value for which a partition number is to be returned.
lower_bound
The lower boundary for the range of values to be partitioned equally.
upper_bound
The upper boundary for the range of values to be partitioned equally.
partition_count
Number of partitions to be created.
This value also specifies the width of the partitions by default.
The number of partitions created is partition_count + 2. Partition 0 and partition partition_count + 1 account for values of value_expression that are outside the lower and upper boundaries.