The SELECT Statement - Advanced SQL Engine - Teradata Database

Database Introduction

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qia1556235689628.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1091
lifecycle
previous
Product Category
Teradata Vantageā„¢

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
    • CASESPECIFIC option
    • 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.