SELECT Statement - Analytics Database - Teradata Vantage

Database Introduction

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-09-27
dita:mapPath
gtm1628096154303.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dsm1472253642401
lifecycle
latest
Product Category
Teradata Vantageā„¢

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

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

You can use the following options, lists, and clauses with the SELECT statement to request data from the 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

A 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 stored procedures.