Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Left Join not working as expected.

Here is the script :

A:

Load * Inline

[id, Category

0,cat0

1,cat1

2,cat2];

B:

Load * Inline

[id, SubCategory

0,subCat0

1,subCat1

3,subCat3];

Left Join(A)

Load *

Resident B;

idCategorySubCategory
0cat0subCat0
1cat1subCat1
2cat2
3
subCat3

Was not expecting the row corresponding to id=3 here.

while :

Roght Join(A)

Load *

Resident B;

idCategorySubCategory
0cat0subCat0
1cat1subCat1
3
subCat3

Could some one help me with it ?

10 Replies
johnw
Champion III
Champion III

abhiagar wrote:

But why is not the same thing happening while doing a right join. I have not dropped A either.


Right join (A) resident B only keeps rows in A that are also in B.  You're telling it you only want rows that exist in the "right" table (B).  You should still drop B, but you don't see the extra row because it no longer exists.