Matching Types
This table shows how each of the SQL JOINs is named in Unaric Segment and how the results are represented as the green shaded area in a Venn diagram. Below the table, you will see what the results are when each of these MATCHes is applied to two sample Data Extensions.
Name | SQL Query | Venn Diagram (results in green) | Description |
|---|---|---|---|
A WITH/WITHOUT MATCHING B | LEFT JOIN | Return all the records from (A) with or without matching data from records in (B) | |
A WITH MATCHING B | INNER JOIN | Return only the records from (A) and (B) with a matching value in the matching field | |
B WITH/WITHOUT MATCHING A | RIGHT JOIN | Return all the records from (B) with or without matching data from records in (A) | |
A WITH ALL B | FULL OUTER JOIN | Return all records from (A) and (B), with or without matching data from the opposite Data Extension | |
A WITHOUT MATCHING B | LEFT OUTER JOIN | Return the records in (A) that don’t have a matching record in (B) | |
B WITHOUT MATCHING A | RIGHT OUTER JOIN | Return the records in (B) that don’t have a matching record in (A) | |
EACH FROM A WITH EACH FROM B | CROSS JOIN | Returns for each and every record in (A) a paired combination with each and every record in (B) |
Examples
For explanation purposes, the following two Data Extensions will be used: Customer and Orders. They contain customer and order information, respectively, and these two Data Extensions will be MATCHed (JOINed) on the fields Customer.Id = Orders.Customer Id.
The examples show the results when a particular MATCH (JOIN) is applied to these two Data Extensions.
The customer Lisa will be duplicated because her record matches with two orders, so she will appear twice, once with the information of each order she did. This will happen in every matching relationship between Customers and Orders.