Logical explanation - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

The WHERE clause appears later in the query than the ON clause. Because of this, the WHERE clause predicates are evaluated after the ON clause predicates.

The result table for the ON clause has 18,034 rows. When the WHERE clause predicate b.data_year_month=199707 is applied, you should expect the ensuing result table to have fewer rows because this condition eliminates any results rows where b.data_year_month is null, and an outer join, by definition, produces results nulls on selection predicates.