**Describe the unexpected behaviour**
Not found column number in block error when specifying ORDER BY that uses a column not mentioned in the SELECT.

**How to reproduce**
```
:) select count() over (order by number + 1) from numbers(10) order by number

Code: 10. DB::Exception: Received from localhost:9000. DB::Exception: Not found column number in block. There are only columns: count() OVER (ORDER BY number + 1 ASC), plus(number, 1)
```

**Expected behavior**
It should work.

joined_plan.reset();
            return direct_join;
        }
    }
    if (analyzed_join->isEnabledAlgorithm(JoinAlgorithm::PARTIAL_MERGE) ||
        analyzed_join->isEnabledAlgorithm(JoinAlgorithm::PREFER_PARTIAL_MERGE))
    {
        if (MergeJoin::isSupported(analyzed_join))
            return std::make_shared<MergeJoin>(analyzed_join, right_sample_block);
    }
    if (analyzed_join->isEnabledAlgorithm(JoinAlgorithm::HASH) ||
        
        analyzed_join->isEnabledAlgorithm(JoinAlgorithm::PREFER_PARTIAL_MERGE) ||
        analyzed_join->isEnabledAlgorithm(JoinAlgorithm::PARALLEL_HASH))
    {
        if (analyzed_join->allowParallelHashJoin())
            return std::make_shared<ConcurrentHashJoin>(context, analyzed_join, context->getSettings().max_threads, right_sample_block);
        return std::make_shared<HashJoin>(analyzed_join, right_sample_block);
    }
    if (analyzed_join->isEnabledAlgorithm(JoinAlgorithm::FULL_SORTING_MERGE))
    {
        if (FullSortingMergeJoin::isSupported(analyzed_join))
            return std::make_shared<FullSortingMergeJoin>(analyzed_join, right_sample_block);
    }
    if (analyzed_join->isEnabledAlgorithm(JoinAlgorithm::AUTO))
        return std::make_shared<JoinSwitcher>(analyzed_join, right_sample_block);
    throw Exception("Can't execute any of specified algorithms for specified strictness/kind and right storage type",
                     ErrorCodes::NOT_IMPLEMENTED);
}
static std::unique_ptr<QueryPlan> buildJoinedPlan(