SUBQUERIES
Subqueries are used to incorporate more than one SELECT in a query. The second, or subsequent SELECT statements, may be in the main SELECT, the FROM or the WHERE and HAVING clauses.
A subquery in the FROM clause is referred to as an inline view. Compass queries do not support all alias functionality for inline views. For example, a property alias in an inline view cannot have a second alias in the outer query.
Compass has limited support for correlated subqueries.