Table of Contents

Search

  1. Preface
  2. Informatica Developer
  3. The Model Repository
  4. Searches in Informatica Developer
  5. Connections
  6. Physical Data Objects
  7. Flat File Data Objects
  8. Logical View of Data
  9. Viewing Data
  10. Application Deployment
  11. Object Import and Export
  12. Data Type Reference
  13. Keyboard Shortcuts
  14. Connection Properties

Developer Tool Guide

Developer Tool 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 resource name. With a left outer join, the Data Integration Service returns all rows in this resource.
source2
Source resource name. The Data Integration Service returns rows from this resource 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 Data 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 Data 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 Data 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 Data 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 Data Integration Service uses NULLs for missing values.

0 COMMENTS

We’d like to hear from you!