Rules and Restrictions for the TOP n Operator - Teradata Database - Teradata Vantage NewSQL Engine

SQL Data Manipulation Language

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
fbo1512081269404.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™
You cannot specify the TOP n operator in any of these SQL statements or statement components:
  • Correlated subquery
  • Subquery in a search condition
  • CREATE JOIN INDEX
  • CREATE HASH INDEX
  • Seed statement or recursive statement in a CREATE RECURSIVE VIEW statement or WITH RECURSIVE statement modifier
  • Subselects of set operations.
You cannot specify these options in a SELECT statement that specifies the TOP n operator:
  • DISTINCT option
  • QUALIFY clause
  • SAMPLE clause
  • WITH clause

    This restriction refers to the WITH clause you can specify for summary lines and breaks. See WITH Clause. The nonrecursive WITH statement modifier that can precede the SELECT keyword can be included in statements that also specify the TOP n operator. See WITH Modifier.

  • ORDER BY clause where the sort expression is an ordered analytical function.

You cannot specify the n value of a TOP n specification as a USING parameter for iterated array processing. For an example, see Example: Non-Support for Iterated Requests With TOP n.