15.00 - 15.10 - The SELECT Statement - Teradata Database

Teradata Database Introduction to Teradata

Teradata Database
Release Number
Content Type
User Guide
Publication ID
English (United States)
Last Update

SELECT is probably the most frequently used SQL statement. It specifies the table columns from which to obtain the data you want, the corresponding database (if different from the current default database), and the table or tables that you need to reference within that database.

The SELECT statement further specifies how, in what format, and in what order the system returns the set of result data.

You can use the following options, lists, and clauses with the SELECT statement to request data from Teradata Database. The list is not exhaustive.

  • DISTINCT option
  • FROM clause
  • WHERE clause, including subqueries
  • GROUP BY clause
  • HAVING clause
  • QUALIFY clause
  • ORDER BY clause
  • International sort orders
  • WITH clause
  • Query expressions and set operators
  • Another variation is the SELECT INTO statement, which is used in embedded SQL and stored procedures. This statement selects at most one row from a table and assigns the values in that row to host variables in embedded SQL or to local variables or parameters in Teradata Database stored procedures.