WHERE, HAVING, and QUALIFY Clause Usage - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

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.