Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HIVE SQL Subquery in WHERE Clause

Tags:

sql

hive

I have two tables with similar fields but the query is failing when I am doing a SELECT subquery in a WHERE clause.

SELECT foo 
FROM   bar
WHERE  fizz IN (SELECT fizz FROM fuzz)

I deleted the error.log from AWS but the error was something to the extent that HIVE did not recognize the SELECT.

How do I need to restructure this query?

Thanks.

like image 344
user2715877 Avatar asked Sep 30 '14 15:09

user2715877


1 Answers

From the Subqueries in the WHERE Clause section of the HIVE Language Manual:

SELECT b.foo FROM bar b WHERE b.fizz IN (SELECT f.fizz FROM fuzz f)
like image 85
Myles Baker Avatar answered Oct 22 '22 22:10

Myles Baker