Converting ANSI Join Syntax to Comma Join Syntax - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

This rewrite converts ANSI-style inner join syntax to comma-style syntax if the entire query is based on inner joins. For example, consider the following query:

SELECT *
FROM t1
INNER JOIN t2 ON a1=a2
INNER JOIN t3 ON a2=a3;

This query is converted to the following form by the rewrite:

SELECT *
FROM t1,t2,t3
WHERE a1=a2
AND   a2=a3;

The conversion of a join from INNER join syntax to the equivalent comma syntax presents one canonical form of inner joins to the Join Planner. This guarantees consistent plans for both INNER join and comma syntaxes and eliminates the need for duplicate code to handle both.