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

Teradata Vantage™ - SQL Request and Transaction Processing

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

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.