Row Expressions

Team-Fly    

 
DB2 Universal Database for OS/390 v7.1 Application Certification Guide
By Susan Lawson
Table of Contents
Chapter 4.  Advanced SQL Coding

Row Expressions

Row expressions are an extension to predicates. They 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) 

Team-Fly    
Top


DB2 Universal Database for OS. 390 v7. 1 Application Certification Guide
DB2(R) Universal Database for OS/390 V7.1 Application Certification Guide (IBM DB2 Certification Guide Series)
ISBN: 0131007718
EAN: 2147483647
Year: 2002
Pages: 163
Authors: Susan Lawson

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