|Oracle® OLAP DML Reference
10g Release 1 (10.1)
Part Number B10339-02
WIDTH_BUCKET (expr , min_value , max_value , num_buckets)
The expression for which the histogram is being created. This expression must evaluate to a number or a datetime value. When expr evaluates to
NA, then the expression returns
An expression that resolves to the minimum end point of the acceptable range for expr. This expression must evaluate to number or datetime values, and cannot evaluate to
An expression that resolves to the maximum end point of the acceptable range for expr. This expression must evaluate to number or datetime values, and cannot evaluate to
An expression that resolves to a constant indicating the number of buckets. This expression must evaluate to a positive INTEGER.
The function also creates (when needed) an underflow bucket numbered
0 and an overflow bucket numbered num_buckets
+1. These buckets handle values less than min_value and more than max_value and are helpful in checking the reasonableness of endpoints.
WIDTH_BUCKET lets you construct equiwidth histograms, in which the histogram range is divided into intervals that have identical size. (Compare this function with NTILE, which creates equiheight histograms.) Ideally each bucket is a "closed-open" interval of the real number line. For example, a bucket can be assigned to cores between
19.999... to indicate that
10 is included in the interval and
20 is excluded. This is sometimes denoted