WHERE, HAVING, and QUALIFY Clause Usage - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
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.