Converting ANSI Join Syntax To Comma Join Syntax - Advanced SQL Engine - Teradata Database

SQL Request and Transaction Processing

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

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 them both.