You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE IF NOT EXISTS t0
(
`id` INT UNSIGNED NOT NULL,
`rev` INT UNSIGNED NOT NULL,
`content` varchar(200) NOT NULL
)
ENGINE = MergeTree
PRIMARY KEY (id, rev)
CREATE TABLE IF NOT EXISTS t1
(
`id` INT UNSIGNED NOT NULL,
`rev` INT UNSIGNED NOT NULL,
`content` varchar(200) NOT NULL
)
ENGINE = MergeTree
PRIMARY KEY (id, rev)
SELECT SUM(t1.rev) AS aggr
FROM t1
INNER JOIN t0 AS right_0 ON t1.id = right_0.id
INNER JOIN t1 AS right_1 ON t1.id = right_1.id
Query id: 638e23fa-f416-4207-9280-9e0dff15448c
0 rows in set. Elapsed: 0.014 sec.
Received exception from server (version 22.13.1):
Code: 207. DB::Exception: Received from localhost:9000. DB::Exception: JOIN database3TLPAggregate.t1 ALL INNER JOIN database3TLPAggregate.t0 AS right_0 ON id = id ALL INNER JOIN database3TLPAggregate.t1 AS right_1 ON t1.id = right_1.id ambiguous identifier 't1.id'. In scope SELECT SUM(t1.rev) AS aggr FROM t1 INNER JOIN t0 AS right_0 ON t1.id = right_0.id INNER JOIN t1 AS right_1 ON t1.id = right_1.id. (AMBIGUOUS_IDENTIFIER)
@kitaisreal can we resolve this types or ambuguity?
I even thought that we can have a setting that defines how we scope aliases - as in SQL standard or ClickHouse way
The text was updated successfully, but these errors were encountered:
MySQL resolves aliases correctly
http://sqlfiddle.com/#!9/0acdc0/2
Postgres also does not complain:
http://sqlfiddle.com/#!17/daee03/1
@kitaisreal can we resolve this types or ambuguity?
I even thought that we can have a setting that defines how we scope aliases - as in SQL standard or ClickHouse way
The text was updated successfully, but these errors were encountered: