Table of Contents

Search

  1. Preface
  2. Working with Transformations
  3. Aggregator Transformation
  4. Custom Transformation
  5. Custom Transformation Functions
  6. Data Masking Transformation
  7. Data Masking Examples
  8. Expression Transformation
  9. External Procedure Transformation
  10. Filter Transformation
  11. HTTP Transformation
  12. Identity Resolution Transformation
  13. Java Transformation
  14. Java Transformation API Reference
  15. Java Expressions
  16. Java Transformation Example
  17. Joiner Transformation
  18. Lookup Transformation
  19. Lookup Caches
  20. Dynamic Lookup Cache
  21. Normalizer Transformation
  22. Rank Transformation
  23. Router Transformation
  24. Sequence Generator Transformation
  25. Sorter Transformation
  26. Source Qualifier Transformation
  27. SQL Transformation
  28. Using the SQL Transformation in a Mapping
  29. Stored Procedure Transformation
  30. Transaction Control Transformation
  31. Union Transformation
  32. Unstructured Data Transformation
  33. Update Strategy Transformation
  34. XML Transformations

Transformation Guide

Transformation Guide

Left Outer Join Syntax

Left Outer Join Syntax

You can create a left outer join with a join override. You can enter multiple left outer joins in a single join override. When using left outer joins with other joins, list all left outer joins together, after any normal joins in the statement.
To create a left outer join, use the following syntax:
{
source1
LEFT OUTER JOIN
source2
on
join_condition
}
The following tables displays syntax for left outer joins in a join override:
Syntax
Description
source1
Source table name. With a left outer join, the Integration Service returns all rows in this table.
source2
Source table name. The Integration Service returns rows from this table that match the join condition.
join_condition
Condition for the join. Use syntax supported by the source database. You can combine multiple join conditions with the AND operator.
For example, using the same REG_CUSTOMER and PURCHASES tables described in Normal Join Syntax, you can determine how many customers bought something in June with the following join override:
{ REG_CUSTOMER LEFT OUTER JOIN PURCHASES on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID }
The Integration Service returns the following data:
CUST_ID
FIRST_NAME
LAST_NAME
DATE
AMOUNT
00001
Marvin
Chi
6/10/2000
255.56
00002
Dinah
Jones
6/3/2000
55.79
00003
John
Bowden
NULL
NULL
00004
J.
Marks
6/15/2000
534.95
00002
Dinah
Jones
6/10/2000
104.45
00002
Dinah
Jones
6/21/2000
98.65
The Integration Service returns all registered customers in the REG_CUSTOMERS table, using null values for the customer who made no purchases in June. It does not include purchases made by non-registered customers.
Use multiple join conditions to determine how many registered customers spent more than $100.00 in a single purchase in June:
{REG_CUSTOMER LEFT OUTER JOIN PURCHASES on (REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID AND PURCHASES.AMOUNT > 100.00) }
The Integration Service returns the following data:
CUST_ID
FIRST_NAME
LAST_NAME
DATE
AMOUNT
00001
Marvin
Chi
6/10/2000
255.56
00002
Dinah
Jones
6/10/2000
104.45
00003
John
Bowden
NULL
NULL
00004
J.
Marks
6/15/2000
534.95
You might use multiple left outer joins if you want to incorporate information about returns during the same time period. For example, the RETURNS table contains the following data:
CUST_ID
CUST_ID
RETURN
00002
6/10/2000
55.79
00002
6/21/2000
104.45
To determine how many customers made purchases and returns for the month of June, use two left outer joins:
{ REG_CUSTOMER LEFT OUTER JOIN PURCHASES on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID LEFT OUTER JOIN RETURNS on REG_CUSTOMER.CUST_ID = PURCHASES.CUST_ID }
The Integration Service returns the following data:
CUST_ID
FIRST_NAME
LAST_NAME
DATE
AMOUNT
RET_DATE
RETURN
00001
Marvin
Chi
6/10/2000
255.56
NULL
NULL
00002
Dinah
Jones
6/3/2000
55.79
NULL
NULL
00003
John
Bowden
NULL
NULL
NULL
NULL
00004
J.
Marks
6/15/2000
534.95
NULL
NULL
00002
Dinah
Jones
6/10/2000
104.45
NULL
NULL
00002
Dinah
Jones
6/21/2000
98.65
NULL
NULL
00002
Dinah
Jones
NULL
NULL
6/10/2000
55.79
00002
Dinah
Jones
NULL
NULL
6/21/2000
104.45
The Integration Service uses NULLs for missing values.

0 COMMENTS

We’d like to hear from you!