Add support for subqueries