I want to subset all rows of TableA with key that appears in TableB.
TableA -
Idn X Y ...
12 * *
13 * *
14 * *
TableB -
Idn A B C ...
12 * * *
12 * * *
14 * * *
I want to select all elements in TableA with key appearing in TableB.
The following SQL query doesn't work in Hive -
select * from TableA where Idn in (select distinct Idn from TableB) a;
Is there any other way I can do it?
Can it be done in a single query?
Note that neither table need not be unique in the Idn.
select a.* from tablea a inner join (select distinct idn from tableb) b on a.idn=b.idn. Is this the best way? - KalEl