FROM seed_statement_source - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

Names of one or more tables or views from which expression is to be derived.

The FROM clause in a seed statement must not reference view_name.

Either the FROM clause in a recursive statement or a subquery specified within the recursive statement must reference view_name.

See Teradata Vantage™ - SQL Data Manipulation Language, B035-1146 for information about the FROM clause.

database_name
user_name
Containing database or user for table_name if something other than the current database.
table_name
Table from which to derive expression.
correlation_name
An alias name for the user base table that is referenced by table_name.
Correlation names are used to name table expressions and must always be specified for a self-join operation on the table.
Correlation names are also referred to as range variables.
database_name
user_name
Containing database or user for joined_table if something other than the current database or user.
joined_table
Name of a joined user base table or view.

You cannot create or replace a view on a queue table (see CREATE TABLE (Queue Table Form)).

join_on

INNER
A join in which qualifying rows from one table are combined with qualifying rows from another table according to a specified join condition.
INNER is the form specified by the ANSI SQL-2011 standard. Teradata also supports an extension that allows you to separate join relations using COMMA characters.
Inner join is the default join type for view definitions.
OUTER
A join in which qualifying rows from one table or view that do not have matches in the other table or view, are included in the join result. The rows from the outer table or view are extended with nulls.
Outer joins are only valid selectively in recursive view definitions. See the individual outer join types for specific information.
See Teradata Vantage™ - SQL Data Manipulation Language, B035-1146 for more information about outer joins.
LEFT OUTER
An outer join on the table or view that was listed first in the FROM clause.
In a LEFT OUTER JOIN, the rows from the left table or view that are not returned in the result of the inner join of the two tables/views are returned in the outer join result and extended with nulls.
A left outer join is valid when coded within a seed statement.
Left outer joins are only valid within a recursive statement when the recursive query reference is the inner, or left, table in the outer join definition.
RIGHT OUTER
An outer join on the table or view that was listed second in the FROM clause.
In a RIGHT OUTER JOIN, the rows from the right table or view that are not returned in the result of the inner join of the two tables/views are returned in the outer join result and extended with nulls.
A right outer join is valid when coded within a seed statement.
Right outer joins are only valid within a recursive statement when the recursive query reference is the outer, or right, table in the outer join definition.
FULL OUTER
A join that returns rows, including non-qualifying rows, from both tables or views.
In a FULL OUTER JOIN, rows from both tables that have not been returned in the result of the inner join are returned in the outer join result, and extended with nulls.
Full outer joins are only valid when coded within a seed statement.
One or more conditional expressions that must be satisfied by the result rows. An ON condition clause is required if the FROM clause specifies outer join syntax.
You cannot specify a SAMPLE clause within a subquery predicate within an ON clause.
CROSS JOIN
A CROSS JOIN is an unconstrained, or Cartesian join. The Cartesian product of two tables/views returns a concatenated product of all rows from all tables or views specified in the FROM clause.
database_name
user_name
Containing database or user for single_table if something other than the current database or user.
single_table
Name of a user base table or view participating in the join.
You cannot create or replace a view on a queue table (see CREATE TABLE and CREATE TABLE … AS).
subquery
A SELECT statement that defines the derived table.
derived_table_name
Name of a derived table.
For information about naming database objects, see Teradata Vantage™ - SQL Fundamentals, B035-1141.
column_name
A column name for a member of the set of all column names specified in the subquery select list.
Specify only an unqualified column name here; do not use fully qualified forms such as the following:
  • databasename.tablename.columnname
  • tablename.columnname