Select List - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database
 

Syntax Element …

Specifies …

*

that all columns of all tables referenced in the FROM clause be returned.

When qualified by table_name, specifies that all columns of table_name only are to be returned.

View columns are explicitly enumerated when views are defined. If a table is changed after a view is defined, those changes will not appear if you perform a SELECT * query.

Note that SELECT * …  is a column operation, projecting all the columns of a table, while SELECT COUNT(*)… is a row operation, restricting and then counting all the rows of a table), reporting the cardinality of the table in question. The semantics of the asterisk are orthogonal in the two cases.

Since these derived columns are not actual columns of a table, you must explicitly specify PARTITION or PARTITION#Ln, where n ranges from 1 to 62, inclusive, to project the PARTITION or PARTITION#Ln columns for the table.

expression

any valid SQL expression, including scalar subqueries and scalar UDFs.

If you specify a scalar UDF, it must return a value expression.

You can specify an expression that returns a UDT in a column list only if its transform group has a fromsql routine. The system automatically converts the expression from its UDT value to the external type via the fromsql routine before returning it to a client application. See “Specifying UDTs in an SQL Request” on page 19 for details.

AS

an optional introduction to derived_column_name.

expression_alias_name

an alias for the column expression that is derived from expression. You must specify a derived_column_name for self‑join operations.

table_name

the name of a table, queue table, derived table, or view.

table_name.* in the select list can define the table from which rows are to be returned when two or more tables are referenced in the FROM clause.