Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
There are 4 type of joins-
Left Join- All rows from the first table and those rows from the second table that have a corresponding key in the first table, will be included in the result. When no match is found, null values will be shown for the columns that are unique to the second table.
Right Join- All rows from the second table and those rows from the first table which have a corresponding key in the second table, will be included in the result. When no match is found, null values will be shown for the columns that are unique to the first table.
Inner Join- Only rows that can be matched between both tables will be kept in the result.
Outer Join- All rows will be kept in the result, rows that do not have a corresponding value in the other table will get null values for the fields that are unique to that table. When no prefix is specified, this is the default join type that will be used.
For Example-
Suppose there are 2 tables
Table1:
LOAD * Inline
[
Key, ColA
1,R1
2,R2
3,R3
];
Table2:
LOAD * Inline
[
Key, ColC
1,F1
2,F2
4,F4
];
Nice share!
Nice share!