Added test with subquery