Add support for subquery