Example: Join Before Expansion - 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
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantageā„¢

Following are the table definitions for this example:

     CREATE SET TABLE DR.t3, NO FALLBACK , NO BEFORE JOURNAL,
                             NO AFTER JOURNAL, CHECKSUM = DEFAULT (
       a  INTEGER,
       b  INTEGER,
       pd PERIOD(TIMESTAMP(6)))
     PRIMARY INDEX (a);
     CREATE SET TABLE DR.t4, NO FALLBACK, NO BEFORE JOURNAL,
                             NO AFTER JOURNAL, CHECKSUM = DEFAULT (
       x  INTEGER NOT NULL,
       y  INTEGER NOT NULL,
       pd PERIOD(DATE))
     PRIMARY INDEX (x);

This example shows how the database joins the tables specified in an EXPAND ON clause when the specified period expression specifies a column from a table that is not specified in the FROM clause .

     SELECT expd
             FROM t4
             EXPAND ON t3.pd AS expd;

An EXPLAIN shows a JOIN with t3.