NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
I-3
IN Predicate
Use IF/THEN/ELSE to print a default value as blanks:
S> DETAIL ORDERNUM,
+> IF DELIV_DATE <> 0 THEN ( DELIV_DATE AS DATE * );
Use IF/THEN/ELSE to convert values to text:
S> DETAIL CUSTNUM, CUSTNAME,
+> IF CREDIT = "A1" THEN ("EXCELLENT") ELSE
+> ( IF CREDIT = "B1" THEN ("GOOD") ELSE
+> ( IF CREDIT = "C1" THEN ("FAIR")))
+> HEADING "CREDIT RATING";
IN Predicate
IN is a predicate that determines if a value is equal to any of the values in a list or
collection of values.
subquery
is a subquery that has a result table of one column. See Subqueries on page S-81 for
more information.
expression1 or expression
is an expression. See Expressions on page E-23 for more information.
The data type (including the character set for a character data type) of
expression1 must be compatible with the data type of the value returned by the
subquery or the results of all expressions in the list.
Rules for comparisons of string and numeric values are the same as for comparison
predicates. See Comparison Predicate
on page C-53 for more information.
The maximum number of expressions you can specify in expression-list is
500.
Considerations—IN
The IN predicate is true if either of the following is true:
expression1 [ NOT ] IN { ( subquery ) }
{ ( expression-list ) }
expression-list is:
expression [ , expression ] ...