SQL SELECT Statement | Data Manipulation Language | Teradata Vantage - SELECT - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

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
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

Returns specific row data in the form of a result table.

Virtual columns can appear anywhere in a SELECT statement.

Vantage uses WHERE clause conditions on actual or virtual partition columns to optimize path filters. Elsewhere in the query, Vantage treats actual partition columns as table columns.

For definitions of actual column and virtual column, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.

For information about syntax that is compatible with temporal tables, see Teradata Vantage™ - ANSI Temporal Table Support, B035-1186 and Teradata Vantage™ - Temporal Table Support, B035-1182.

ANSI Compliance

SELECT is ANSI SQL:2011-compliant with extensions.

In Teradata SQL, the FROM clause is optional. This is a Teradata extension to the ANSI SQL:2011 standard, in which a FROM clause is mandatory.

The WITH, SAMPLE, QUALIFY, and TOP clauses are Teradata extensions to the ANSI SQL:2011 standard.

The documented syntax specifies the ANSI SQL:2011 ordering of these clauses: FROM, WHERE, GROUP BY, HAVING, and ORDER BY. The database does not enforce this ordering, but you should observe it when you write applications to maintain ANSI compliance.

Required Privileges

To select data from a table, you must have the SELECT privilege on the table or column set being retrieved.

To select data through a view, you must have the SELECT privilege on that view. Also, the immediate owner of the view (that is, the database or user in which the view resides) must have SELECT WITH GRANT OPTION privileges on all tables or views referenced in the view.

If indirect references are made to a table or view, the privileges must be held by the immediate owner of the object being accessed rather than the user executing the query.

For more information, see Teradata Vantage™ - SQL Data Control Language, B035-1149 and Teradata Vantage™ - Database Administration, B035-1093.