16.20 - WHERE, HAVING, and QUALIFY Clause Usage - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Detailed Topics

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1184-162K
Language
English (United States)

The WHERE clause specifies a conditional expression by which rows for the view are to be selected.

The HAVING clause specifies a conditional expression by which the groups defined by a GROUP BY clause are to be selected.

The QUALIFY clause specifies a conditional expression used to filter the results of a previously computed ordered analytical function according to user-specified conditions.

You cannot specify a SAMPLE clause within a subquery predicate within a WHERE, HAVING, or QUALIFY clause.

Joins can only be defined in the HAVING clause of a view when that HAVING clause is part of a subquery.

Do not use SELECT * in a subquery if any underlying table or view might be modified.

Names are resolved and columns are defined when the view is defined; therefore, changes to the table are not incorporated into the view definition if the SELECT * construct is used.