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

EXISTS Predicate

EXISTS Predicate

The [NOT] EXISTS predicate tests a subquery for the presence of a value. If the subquery returns at least one value, the EXISTS predicate evaluates to TRUE, while a NOT EXISTS predicate evaluates to FALSE. Its syntax is as follows:
Note that a
correlated
subquery is supported with some restrictions:
  • A correlated EXISTS predicate cannot appear in the HAVING clause.
  • Correlation can be used in the WHERE and HAVING clauses of the subquery.
  • Only one correlated column is allowed in the subquery, but it can be part of multiple conditions in the WHERE and HAVING clauses.
For instance, the following clauses are allowed in an EXISTS subquery ('outer' is a table reference from the outer query):
WHERE outer.c1 != inner.c1 WHERE outer.c1 > 15 AND inner.c2 > outer.c1 WHERE outer.c1 > 15 AND outer.c1*3 <= inner.c1 OR outer.c1 = 0 WHERE outer.c1 > 15 ... HAVING MAX(outer.c1) > 40
But the following are disallowed:
WHERE outer.c1 > 15 AND outer.c2 <= inner.c2 WHERE outer.c1 > 15 ... HAVING MAX(outer.c2) > 10

0 COMMENTS

We’d like to hear from you!