Add subquery functionality to QueryCollection.