Row Expressions


Row expressions are an extension to predicates and allow more than one set of comparisons in a single predicate, using a subquery that returns more than one column and even more than one row. In the following example, the WHERE clause predicate will be trUE when all three columns on the left equal the three values in any single row returned in the result set from the subquery. This will also allow the use of quantified predicates, such as = ANY, = SOME, or <> ALL, with row expressions:

 SELECT * FROM TABLE WHERE (COL1, COL2, COL3) IN    (SELECT COLA, COLB, COLC     FROM TABLE     UNION ALL     SELECT COLX, COLY, COLZ     FROM ANOTHER_TABLE) 



DB2 for z. OS Version 8 DBA Certification Guide
DB2 for z/OS Version 8 DBA Certification Guide
ISBN: 0131491202
EAN: 2147483647
Year: 2003
Pages: 175
Authors: Susan Lawson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net