leftouter join
Learn how to use the leftouter join flavor to merge the rows of two tables.
The leftouter join flavor returns all the records from the left side table and only matching records from the right side table.

Syntax
LeftTable | join kind=leftouter [ Hints ] RightTable on Conditions
Returns
Schema: All columns from both tables, including the matching keys.
Rows: All records from the left table and only matching rows from the right table.
Example
The result of a left outer join for tables X and Y always contains all records of the left table (X), even if the join condition doesn’t find any matching record in the right table (Y).
let X = datatable(Key:string, Value1:long)
[
'a',1,
'b',2,
'b',3,
'c',4
];
let Y = datatable(Key:string, Value2:long)
[
'b',10,
'c',20,
'c',30,
'd',40
];
X | join kind=leftouter Y on Key
Output
| Key | Value1 | Key1 | Value2 |
|---|---|---|---|
| a | 1 | ||
| b | 2 | b | 10 |
| b | 3 | b | 10 |
| c | 4 | c | 20 |
| c | 4 | c | 30 |
Related content
- Learn about other join flavors
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.