The join library

The join library contains four operators. The operators let you join data rows together in different ways.

The innerjoin, leftouterjoin, and rightouterjoin operators accept two or more input data sets and perform cascading joins on them. The fulloutjoin operator accepts exactly two data sets. All four operators output a single data set.

In this topic, the first input data set and a data set resulting from an intermediate join are called the left data set and the data set joining them is called the right data set.

Here is a brief description of each join operator:

  • The innerjoin operator outputs the records from two or more input data sets whose key fields contain equal values. Records whose key fields do not contain equal values are dropped.
  • The leftouterjoin operator outputs all values from the left data set and outputs values from the right data set only where key fields match. The operator drops the key field from the right data set. Otherwise, the operator writes default values.
  • The rightouterjoin operator outputs all values from the right data set and outputs values from the left data set only where key fields match. The operator drops the key field from the left data set. Otherwise, the operator writes default values.
  • The fullouterjoin operator transfers records in which the contents of the key fields are equal from both input data sets to the output data set. It also transfers records whose key fields contain unequal values from both input data sets to the output data set.