**Describe the unexpected behaviour**

The column resolution seems to resolve an alias to the wrong column when there is a left join in the query.

**How to reproduce**
* Which ClickHouse server version to use: `20.3.12.112`
* Which interface to use, if matters: HTTP Interface (but should not matter)

Please run the following queries:
```sql
-- Tables
CREATE TABLE default.tableConversion (
	conversionId String,
	value Nullable(Double)
) ENGINE = Log();

CREATE TABLE default.tableClick (
	clickId String,
	conversionId String,
	value Nullable(Double)
) ENGINE = Log();

CREATE TABLE default.leftjoin (
	id String
) ENGINE = Log();

-- Values
INSERT INTO default.tableConversion(conversionId, value) VALUES ('Conversion 1', 1);
INSERT INTO default.tableClick(clickId, conversionId, value) VALUES ('Click 1', 'Conversion 1', 14);
INSERT INTO default.tableClick(clickId, conversionId, value) VALUES ('Click 2', 'Conversion 1', 15);
INSERT INTO default.tableClick(clickId, conversionId, value) VALUES ('Click 3', 'Conversion 1', 16);

-- Query
SELECT
	conversion.conversionId as myConversionId,
	click.clickId as myClickId,
	click.myValue as myValue
FROM (
	SELECT conversionId, value as myValue
	FROM default.tableConversion
) as conversion
INNER JOIN (
	SELECT clickId, conversionId, value as myValue
	FROM default.tableClick
) as click ON click.conversionId = conversion.conversionId
LEFT JOIN (
	SELECT * FROM default.leftjoin
) as dummy on (dummy.id = conversion.conversionId)
```

**Expected behavior**
The values in the `myValue` column should be 14, 15 and 16.

**Actual behaviour**
The values in the `myValue` column is 1.

This means, that the colum `click.myValue as myValue` gets resolved as `conversion.myValue`. Please notice that the source table has been changed!

**Additional context**

The behaviour is only visible when there is a `LEFT JOIN` in the Query. Referencing the `leftjoin` table in the `SELECT` statement does not change the result. **Leaving the `LEFT JOIN` out of the query makes it return the correct results.**

\
    M(SettingInt64, network_zstd_compression_level, 1, "Allows you to select the level of ZSTD compression.", 0) \
    \
    M(SettingUInt64, priority, 0, "Priority of the query. 1 - the highest, higher value - lower priority; 0 - do not use priorities.", 0) \
    M(SettingInt64, os_thread_priority, 0, "If non zero - set corresponding 'nice' value for query processing threads. Can be used to adjust query priority for OS scheduler.", 0) \
    \
    M(SettingBool, log_queries, 1, "Log requests and write the log to the system table.", 0) \
    M(SettingLogQueriesType, log_queries_min_type, QueryLogElementType::QUERY_START, "Minimal type in query_log to log, possible values (from low to high): QUERY_START, QUERY_FINISH, EXCEPTION_BEFORE_START, EXCEPTION_WHILE_PROCESSING.", 0) \
    M(SettingUInt64, log_queries_cut_to_length, 100000, "If query length is greater than specified threshold (in bytes), then cut query when writing to query log. Also limit length of printed query in ordinary text log.", 0) \
    \
    M(SettingDistributedProductMode, distributed_product_mode, DistributedProductMode::DENY, "How are distributed subqueries performed inside IN or JOIN sections?", IMPORTANT) \
    \
    M(SettingUInt64, max_concurrent_queries_for_user, 0, "The maximum number of concurrent requests per user.", 0) \
    \
    M(SettingBool, insert_deduplicate, true, "For INSERT queries in the replicated table, specifies that deduplication of insertings blocks should be preformed", 0) \
    \
    M(SettingUInt64, insert_quorum, 0, "For INSERT queries in the replicated table, wait writing for the specified number of replicas and linearize the addition of the data. 0 - disabled.", 0) \
    M(SettingMilliseconds, insert_quorum_timeout, 600000, "", 0) \
    M(SettingUInt64, select_sequential_consistency, 0, "For SELECT queries from the replicated table, throw an exception if the replica does not have a chunk written with the quorum; do not read the parts that have not yet been written with the quorum.", 0) \
    M(SettingUInt64, table_function_remote_max_addresses, 1000, "The maximum number of different shards and the maximum number of replicas of one shard in the `remote` function.", 0) \
    M(SettingMilliseconds, read_backoff_min_latency_ms, 1000, "Setting to reduce the number of threads in case of slow reads. Pay attention only to reads that took at least that much time.", 0) \
    M(SettingUInt64, read_backoff_max_throughput, 1048576, "Settings to reduce the number of threads in case of slow reads. Count events when the read bandwidth is less than that many bytes per second.", 0) \
    M(SettingMilliseconds, read_backoff_min_interval_between_events_ms, 1000, "Settings to reduce the number of threads in case of slow reads. Do not pay attention to the event, if the previous one has passed less than a certain amount of time.", 0) \
    M(SettingUInt64, read_backoff_min_events, 2, "Settings to reduce the number of threads in case of slow reads. The number of events after which the number of threads will be reduced.", 0) \
    \
    M(SettingFloat, memory_tracker_fault_probability, 0., "For testing of `exception safety` - throw an exception every time you allocate memory with the specified probability.", 0) \
    \
    M(SettingBool, enable_http_compression, 0, "Compress the result if the client over HTTP said that it understands data compressed by gzip or deflate.", 0) \
    M(SettingInt64, http_zlib_compression_level, 3, "Compression level - used if the client on HTTP said that it understands data compressed by gzip or deflate.", 0) \
    \