我有一个表,有100个字符串,我想添加到where column in (value, value, etc)
,像select cookies from table where field in (select * from table)
我不认为Hive支持in
子句中的子查询,但你可以通过内部连接完成相同的操作:
select table1.cookies
from table1 join table2 on table1.field = table2.field
Hive确实从0.13版本开始支持子查询。所以你可以用这个版本。或者你可以试试这个查询:
select * from table1 t1 JOIN (select 100_string_column as col2 from table2 where (whatever your condition is)) t2 ON t1.<matching_column> = t2.col2
希望这有帮助…!!