Hey,
Hive subquery is a select expression enclosed in parenthesis as a nested query block.
You can use these nested query blocks in any of the following HiveQL statements:
- SELECT
- CREATE TABLE AS
- INSERT INTO
For example,
Select * from stud where id in (select stud_id from dept);