16.20 - TOP n and TOP m PERCENT Clause Usage - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Detailed Topics

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1184-162K
Language
English (United States)

You can restrict a view to only n rows or m percent of the rows in an underlying base table by specifying a TOP n or TOP m PERCENT clause, respectively, in the view definition. This option provides a fast method to obtain a restricted, statistically non-random sample of table rows without scanning the entire table. For example, you might create a view that specifies only the top 10 rows, or only the top 10 percent of the rows, from an orders table.