16.20 - BOTTOM - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Time Series Tables and Operations

Teradata Database
Teradata Vantage NewSQL Engine
Release Number
March 2019
Content Type
Programming Reference
Publication ID
English (United States)
Last Update


Returns the smallest number_of_values in the value_expression for each group, with or without ties. BOTTOM is a single-threaded function.

To invoke the time series version of this function, use the GROUP BY TIME clause. For more information, see GROUP BY TIME Clause.


Syntax Elements

Teradata Database integer value representing the number of values to return.
A literal or column expression from which the bottom values are taken.

The value_expression cannot be a reference to a view column derived from a function, and cannot contain any ordered analytical or aggregate functions.

Return Values

The return values are actual values from the input data set.

Nulls are not included in the computation.

Usage Notes

BOTTOM is valid only for numeric data.

WITH TIES implies that the rows returned include the specified number of rows in the ordered set for each timebucket. It includes any rows where the sort key value is the same as the sort key value in the last row that satisfies the specified number or percentage of rows. If this clause is omitted and ties are found, the earliest value in terms of timecode is returned.