---
schema_version: "1"
id: d01ed74282f761be0731a361a6f436b059aa8a40099f2b3b17771bacf0235767
title: Join Data in a Streaming Transform
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_join_data_streaming_transform.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_join_data_streaming_transform.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 78fc95d3b9ec6c1f97b35d5746f3562caafdb37aa39821f1f2e3a2e7ecb31894
description: "Joins enable data augmentation by combining data from two separate streams based on a primary key. In streaming data transformations, `INNER JOIN` and `LEFT JOIN` clauses in SQL statements are used to combine data from two distinct streams. A join expression consists of two objects: one identifies the object that triggers the streaming transform on update, and the other specifies the object used to evaluate the join."
products:
  - Data 360
release: "264"
---
# Join Data in a Streaming Transform

Joins enable data augmentation by combining data from two separate streams based on a primary key. In streaming data transformations, \`INNER JOIN\` and \`LEFT JOIN\` clauses in SQL statements are used to combine data from two distinct streams. A join expression consists of two objects: one identifies the object that triggers the streaming transform on update, and the other specifies the object used to evaluate the join.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>All Editions</strong> supported by Data 360. See <a href="https://help.salesforce.com/s/articleView?id=data.c360_a_dc_editions.htm&amp;release=264.0.0&amp;type=5" title="Data 360 is available in several supported Salesforce editions. Some Data 360 features also require additional licenses.">Data 360 edition availability</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:left;vertical-align:top;" id="d95861e69">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d95861e69 ">To edit a streaming transform</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d95861e69 ">
              <p>Permission set: </p>
              <ul>
                <li>Data Cloud Architect</li>

              </ul>
            </td>

          </tr>
        </tbody>
      </table>

- The join condition must include the `ON` clause. The `ON` clause has the form `column = column`
- Each side of the `ON` clause can only reference one column from one side of the join, and the other side references the other side of the join.
- Columns used in the ON clause must have the same data type.
- Multiple joins can be combined using additional `INNER JOIN` or `LEFT JOIN` clauses. Up to 5 objects can be joined in one SQL statement.
- Any object that can be used as a source object in a streaming transform can be used in a join.
- The event time field column must be used for non-streaming ‘engagement’ inputs. All other joins must include a primary key from either object in the join.

1. Create a target DLO or DMO for the data of the joined records.
2. Create a new streaming transform by clicking New on the Data Transforms tab.
3. On the Target Data Lake Object or Target Data Model Object page, select the DLO or DMO you created.
4. In the Expression field, enter a SQL statement to define the join.
    
    - Use `INNER JOIN` or `LEFT JOIN` to specify the tables to join.
    - Use `ON` to specify the predicate that determines which records from each table should be matched and included in the final result set.
    - Specify the columns that you want to include in the target DLO.
5. Click **Next**.
6. From the Review section, you can select a streaming source object if multiple streaming sources are available.
    
    When new records are added to the chosen streaming source object, changes in the streaming transform source will cause the transform to run.
7. Click **Save**.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/images/icon_example.png)

Example

This example demonstrates an inner join of two tables: a sessions table and a customer table. The sessions table logs every customer engagement event, recording the customer's ID and the timestamp of their page access. The customer table stores customer information such as age, gender, and ID. Joining this data allows for analysis such as determining the number of customers from a specific state who visited a page on a given date.

**Target DLO**

Create a new DLO by cloning the existing DLO for the sessions table. Include columns that are required for the join from the customers table.

![Columns for the join from the customers table.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/data_cloud/images/c360_a_transform_joins_streaming.png)

**SQL Expression**

`SELECT  sessions__dll.page_visited__c as page_visited__c, sessions__dll.sesson_id__c as session_id__c, sessions__dll.timestamp__c as timestamp__c, sessions__dll.user_id__c as user_id__c, customers_dll.age__c as age__c, ustomers_dll.state__c as state__c, customers_dll.customer_name__c as customer_name__c FROM session__dll INNER JOIN customer__dll ON customers__dll.customer_id__c = sessions__dll.user_id__c`

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:50%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="text-align:left;vertical-align:top;" id="d95861e245">SQL</th>
                <th scope="col" class="slds-cell-wrap" style="text-align:left;vertical-align:top;" id="d95861e248">Description</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="SQL" class="slds-cell-wrap" style="text-align:left;vertical-align:top;" headers="d95861e245 "><code>FROM session__dll INNER JOIN customer__dll</code></td>

                <td data-label="Description" class="slds-cell-wrap" style="text-align:left;vertical-align:top;" headers="d95861e248 ">The tables to join.</td>

              </tr>
              <tr class="">
                <td data-label="SQL" class="slds-cell-wrap" style="text-align:left;vertical-align:top;" headers="d95861e245 "><code>ON customers__dll.customer_id__c = sessions__dll.user_id__c</code></td>

                <td data-label="Description" class="slds-cell-wrap" style="text-align:left;vertical-align:top;" headers="d95861e248 ">The condition from which the records are matched. </td>

              </tr>
              <tr class="">
                <td data-label="SQL" class="slds-cell-wrap" style="text-align:left;vertical-align:top;" headers="d95861e245 ">
                  <p dir="ltr"><code>page_visited</code></p>
                  <p dir="ltr"><code>session_id</code></p>
                  <p dir="ltr"><code>timestamp</code></p>
                  <p dir="ltr"><code>age</code></p>
                  <p dir="ltr"><code>state</code></p>
                  <p style="margin-bottom:0;" dir="ltr"><code>customer_name</code></p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="text-align:left;vertical-align:top;" headers="d95861e248 ">The condition from which the records are matched. </td>

              </tr>
            </tbody>
          </table>

**Results**

If `sessions__dll` is selected as the stream source object when saving the data stream, the transform is only triggered when new records are added to the `sessions__dll` streaming object. New `customer__dll` records don't trigger the streaming transform.