Table of Contents

Search

  1. About the Data Vault SQL Reference
  2. Introduction to SQL Reference for Informatica Data Vault
  3. Date and Time Arithmetic
  4. WHERE Clauses
  5. UNION Operator
  6. Parameterized Query
  7. Functions

Data Vault SQL Reference

Data Vault SQL Reference

Compound Predicates

Compound Predicates

Compound predicates use the operators OR and AND. For example, to display the
sno
column values for all suppliers in “PARIS” with a
status
column value greater than 20, use the following query:
SELECT sno FROM supplier WHERE city = 'PARIS' AND status > 20;
This SELECT command statement retrieves
pno
column values for those parts that are either ‘RED’, or weigh more than 15 pounds:
SELECT pno FROM part WHERE color = 'RED' OR weight > 15;
In complex queries, parentheses can be used to indicate the order of evaluation. The condition(s) surrounded by the innermost pair of parentheses are applied first.
SELECT pno, pname FROM part WHERE color = 'green' OR (city = 'LONDON' AND weight < 15);
This last query retrieves
pno
and
pname
column values of all parts that are either green, or are both made in London and have a weight less than 15.
The following table displays the query result:
pno
pname
P1
NUT
P2
BOLT
P4
SCREW

0 COMMENTS

We’d like to hear from you!