Exists - Teradata Warehouse Miner

Teradata Warehouse Miner User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.4
Published
July 2017
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
fcf1492702067123.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

The standard Exists predicate is supported to test whether a subquery in a WHERE clause produces at least one row. The generated SQL takes the form EXISTS (subquery). When dragging an Exists operator into a WHERE clause, something like the following tree element is created.

Variable Creation > Input > Variables: SQL Elements pane - Logical > Exists

To complete the Exists predicate it is necessary to drag a Subquery element from the Other - Expert category onto the empty - Subquery node. Then a Variable Creation analysis must be created to supply the subquery, checking the Expert clause subquery box on the analysis parameters tab of the analysis.

To place the subquery SQL directly into this analysis, further select the Output option to Generate the SQL for this analysis but do not execute it in the subquery analysis.

Finally, a column (any column) produced by this analysis must be selected after setting Input Source to Analysis and selecting the subquery analysis under Analyses, dragging it onto the empty node under the Subquery element. This produces something like the following tree element.

Variable Creation > Input > Variables: SQL Elements pane - Logical > Exists Subquery

There are no special properties for the Exists operator.