---
schema_version: "1"
id: 2382d9afbd122335896c39c94e38a96e2fcfde123d575d1ea5dbb86ced1a03c0
title: Right Join
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_batch_transform_join_rightjoin.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_batch_transform_join_rightjoin.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 095397732c6614de2f6297c5b0e814c3c09aca867de683cadd0f5a12f040b26d
description: A right join includes all rows from the right and only matching rows from the left input data source objects. The join includes all matched rows in the data output when multiple rows match.
products:
  - Data 360
release: "264"
---
# Right Join

A right join includes all rows from the right and only matching rows from the left input data source objects. The join includes all matched rows in the data output when multiple rows match.

![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

Our company's marketing team captures demographic data in an external data source for opportunities stored in Salesforce. To help create more targeted campaigns, the team is segmenting our current opportunities by the Education Level demographic. Let’s use a right join to add the opportunity data to the demographic data.

To illustrate how this batch data transform handles unmatched rows and duplicate keys, we included them in both input data sources.

![The left data stream shows the opportunity ID, customer name, and opportunity amount. The right data stream shows the opportunity ID and educational level.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_integrate_recipeTransformations_rightJoin_dataStreams.png)

After performing the right join based on the matching keys, the data transform produces the following output data.

![The new dataset contains columns from both data streams.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_integrate_recipeTransformations_rightJoin_results.png)

All rows from the right, including those without a match and those with multiple matches, are included in the output. Because `Opp_id` 2 has two matches on the left (Amy and Bob), the target contains a separate record for each of them. Also, because `Opp_id` 5 doesn’t have a match, the `Opp_ID` and `Customer Name` fields are null for that record.

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

Warning If duplicate records contain measures (as shown for `Opp_id` 1 in the following screenshot), don’t double count the measures when aggregating the records. To prevent duplicate records, use a lookup instead of a join.

![The new dataset contains duplicate records for Alice, which makes it possible to doublecount her annual income.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_integrate_recipeTransformations_rightJoin_warning.png)