In - Teradata Warehouse Miner

Teradata® Warehouse Miner™ User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.6
Published
November 2018
Language
English (United States)
Last Update
2018-12-07
dita:mapPath
gxn1538171534877.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

The standard In predicate is supported with a single expression, a list of literal constants or a subquery. That is, it may be used to test whether or not an expression equals another expression, is one of a list of values or is returned from a query. The In predicate generates SQL in one of several forms, shown below.

expression IN expressionexpression IN (literal list)
expression IN (literal TO literal)
expression IN (subquery)
(expression list) IN (subquery)

When dragging an In operator into a variable, the following tree element is created.

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

A column, expression, literal or SQL Element List can be moved into the (empty -In Test Value) branch of the tree. One or more literals or a single column, expression or Subquery element can be moved into the Expressions folder within the tree. To represent a literal TO literal expression, a SQL Text with Arguments element can be selected from the Other category with text set equal to <P1> TO <P2>, and numeric literals or parameters selected as arguments. Some examples include the following.

expression IN expression
Variable Creation > Input > Variables: SQL Elements pane - Logical > In Example 1

expression IN (literal list)
Variable Creation > Input > Variables: SQL Elements pane - Logical > In 2

expression IN (literal list as text)
Variable Creation > Input > Variables: SQL Elements pane - Logical > In 3

expression IN (literal TO literal)
Variable Creation > Input > Variables: SQL Elements pane - Logical > In 4

expression IN (subquery)
Variable Creation > Input > Variables: SQL Elements pane - Logical > In 5

(expression list) IN (subquery)
Variable Creation > Input > Variables: SQL Elements pane - Logical > In 6

The use of the ANY predicate with the IN predicate is optional. That is, IN (…), IN ANY (…) and = ANY (…) are all equivalent. If desired, drop an ANY SQL element onto the Expressions folder and then use the Expressions folder under the ANY node.

There are no special properties for the In operator.