Rules and Restrictions for the TOP n Operator - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.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.