SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-100
Rowset Predicates
The inner query providing the comparison values yields these results:
SELECT partnum
FROM sales.odetail
WHERE qty_ordered > 5;
Part/Num
--------
2403
5100
5103
6301
6500
....
--- 60 row(s) selected.
The SELECT statement using this inner query yields these results. All of the order
numbers listed have part number equal to any part number with more than five
total units in stock—that is, equal to 2403, 5100, 5103, 6301, 6500, and so on:
SELECT ordernum, partnum, qty_ordered
FROM sales.odetail
WHERE partnum = ANY (SELECT partnum
FROM sales.odetail
WHERE qty_ordered > 5);
Order/Num Part/Num Qty/Ord
---------- -------- ----------
100210 244 3
100210 2001 3
100210 2403 6
100210 5100 10
100250 244 4
100250 5103 10
100250 6301 15
100250 6500 10
...... .... ..
--- 71 row(s) selected.
Rowset Predicates
A predicate that contains a rowset expression is called a rowset predicate. A rowset
predicate is an array of single value predicates, where the nth predicate is composed
from nth rowset element. Each array element in a rowset predicate returns true, false
or unknown.
For more information about rowsets, see the SQL/MX Programming Manual for C and
COBOL.