I want to left join Table A with B on A.id=B.id like below:
select A.id,B.name from (select * from TABLEa)A
LEFT JOIN (select * from TABLEb where partition IN ('GOP','LOP')B on A.id=B.id
here my TABLEb is partitioned by two values GOP and LOP.
I also tried to do same query on following approach:
insert overwrite table final
select A.id,B.name from (select * from TABLEa)A
LEFT JOIN (select * from TABLEb where partition IN ('GOP')B on A.id=B.id;
insert INTOtable final
select A.id,B.name from (select * from TABLEa)A
LEFT JOIN (select * from TABLEb where partition IN ('LOP')B on A.id=B.id;
Can any body tell which approach should be better? and reason or what makes second different than first one.
please help