skip to main content
Supported SQL Functionality : Subqueries
  

Try DataDirect Drivers Now

Subqueries

A query is an operation that retrieves data from one or more tables or views. In this reference, a top-level query is called a Select statement, and a query nested within a Select statement is called a subquery.
Subqueries are supported, with the following Entry SQL level restriction: subqueries can only exist in the FROM and WHERE clauses, that is, in a derived table. In the following example, the second Select statement is a subquery:
SELECT * FROM (SELECT * FROM t1 UNION ALL SELECT * FROM t2) sq
Although Impala currently does not support IN or EXISTS subqueries, you can efficiently implement the semantics by rewriting queries to use LEFT SEMI JOIN.