17.10 - seed - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)

The seed statement is a nonrecursive SELECT statement that retrieves row data from other tables to store in the named query.

DISTINCT
Only one row is returned from any set of duplicates that result from a given expression list.
Two rows are considered duplicates only if each value in one is equal to the corresponding value in the other.
ALL
Return all rows, including duplicates, in the results of the expression list. This is the default value.
*
Return all columns of all tables referenced in the FROM clause of the seed statement.
When qualified by table_name, return all columns of table_name only.

seed_selection

expression
Any valid SQL expression, including scalar UDFs.
expression_alias_name
Alias for the expression.
table_name
Name of a 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.
FROM
Introduction to the names of one or more tables, views, or derived tables from which expression is to be derived.
The FROM clause in a seed statement cannot specify the TABLE option.

seed_source

table_name
Name of a single table, derived table, table UDF, or view referred to in the FROM clause.
correlation_name
Alias for the table referenced in the FROM clause.
where_search_condition
Conditional search expression that must be satisfied by the row or rows returned by the seed statement.
If you specify the value for a row-level security constraint in a search condition, that value must be expressed in encoded form.

group_specification

ordinary_group_set
Column expression by which the rows returned by the seed statement are grouped.
The expression cannot group result rows that have a LOB, ARRAY, or VARRAY type.
ordinary_grouping_set falls into three general categories:
  • column_name
  • column_position
  • column_expression
empty_grouping_set
Contiguous LEFT PARENTHESIS, RIGHT PARENTHESIS pair with no argument. You use this syntax to request a grand total of the computed group totals.
rollup_list
ROLLUP expression that reports result rows in a single dimension with one or more levels of detail.
The expression cannot group result rows that have a LOB, ARRAY, or VARRAY type.
cube_list
CUBE expression that reports result rows in multiple dimensions with one or more levels of detail.
The expression cannot group result rows that have a LOB, ARRAY, or VARRAY type.
grouping_sets_specification
GROUPING SETS expression that reports result rows in one of two ways:
  • As a single dimension, but without a full ROLLUP.
  • As multiple dimensions, but without a full CUBE.
having_qualify_search_condition
Conditional expression that must be satisfied by the result rows.
If you specify the value for a row-level security constraint in this search condition, that value must be expressed in encoded form.

order_by_specification

Order in which result rows are to be sorted.

expression
Expression in the SELECT expression list of the seed statement, either by name or by means of a constant that specifies the numeric position of the expression in the expression list.
column_name
Names of columns used in the ORDER BY clause in the SELECT statement. These can be ascending or descending.
column_name_alias
Column name alias specified in the select expression list of the query for the column on which the result rows are to be sorted.
If you specify a column_name_alias to sort by, then that alias cannot match the name of any column that is defined in the table definition for any table referenced in the FROM clause of the query whether that column is specified in the select list or not. The system always references the underlying physical column having the name rather than the column that you attempt to reference using that same name as its alias.
You can specify the sort column by column_position value within the select list for the query.
column_position
Numeric position of the columns specified by the ORDER BY clause. These can be ascending or descending.
ASC
Results are to be ordered in ascending sort order.
If the sort field is a character string, the system orders it in ascending order according to the definition of the collation sequence for the current session.
The default order is ASC.
DESC
Results are to be ordered in descending sort order.
If the sort field is a character string, the system orders it in descending order according to the definition of the collation sequence for the current session.