how to write subquery and use “In” Clause in Hive

后端 未结 7 1787
滥情空心
滥情空心 2021-01-31 19:49

How can I use In clause in Hive I want to write something like this in Hive select x from y where y.z in (select distinct z from y) order by x; But I am not finding any way o

7条回答
  •  梦毁少年i
    2021-01-31 20:37

    I'm using hive version 0.7.1 and SELECT * FROM MYTABLE WHERE MYCOLUMN IN ('thisThing','thatThing');

    I tested this on a column type STRING so I am not sure if this works universally on all data types since I noticed like Wawrzyniec mentioned above that the Hive Language Manual says that it is not supported and to instead use LEFT SEMI JOIN but it worked fine in my test.

提交回复
热议问题