Teradata Limit Query - How to Limit Rows Returned in Query Results

Sometimes it is useful to limit the number of rows that are returned from a query. This can be especially useful when querying very large domains.

The Teradata database provides the ability to limit the number of rows returned from a query starting at the beginning of the results using the top keyword. Listed below are examples of limiting rows with the Teradata database:

Example 1: Returning the first 100 rows from the table named payments: SELECT TOP 100 * FROM payments; Example 2: Returning the first 5 rows from the table named employees: SELECT TOP 5 * FROM employees;

Many other databases also support limiting rows returned from queries. Listed below are links that show how to limit rows for other popular databases: