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
`the column name return from join is ambiguous ,sometimes it return the table.column_name and sometimes it return the column_name rather than table.column_name;
CREATE TABLE test.a
( id Int8, name String
)
ENGINE = Memory
insert into a values (1,'name') ;
SELECT *
FROM
(
SELECT *
FROM a
) AS a1
INNER JOIN
(
SELECT *
FROM a
) AS a2 ON a1.id = a2.id
┌─id─┬─name─┬─a2.id─┬─a2.name─┐
│ 1 │ name │ 1 │ name │
└────┴──────┴───────┴─────────┘
this case return column_name;
SELECT *
FROM
(
SELECT *
FROM a
) AS a1
INNER JOIN
(
SELECT *
FROM a
) AS a2 ON a1.id = a2.id
INNER JOIN
(
SELECT *
FROM a
) AS a3 ON a2.id = a3.id
┌─a1.id─┬─a1.name─┬─a2.id─┬─a2.name─┬─a3.id─┬─a3.name─┐
│ 1 │ name │ 1 │ name │ 1 │ name │
└───────┴─────────┴───────┴─────────┴───────┴─────────┘
this case return table.column_name;`
The text was updated successfully, but these errors were encountered:
`the column name return from join is ambiguous ,sometimes it return the table.column_name and sometimes it return the column_name rather than table.column_name;
CREATE TABLE test.a
(
id
Int8,name
String)
ENGINE = Memory
insert into a values (1,'name') ;
SELECT *
FROM
(
SELECT *
FROM a
) AS a1
INNER JOIN
(
SELECT *
FROM a
) AS a2 ON a1.id = a2.id
┌─id─┬─name─┬─a2.id─┬─a2.name─┐
│ 1 │ name │ 1 │ name │
└────┴──────┴───────┴─────────┘
this case return column_name;
SELECT *
FROM
(
SELECT *
FROM a
) AS a1
INNER JOIN
(
SELECT *
FROM a
) AS a2 ON a1.id = a2.id
INNER JOIN
(
SELECT *
FROM a
) AS a3 ON a2.id = a3.id
┌─a1.id─┬─a1.name─┬─a2.id─┬─a2.name─┬─a3.id─┬─a3.name─┐
│ 1 │ name │ 1 │ name │ 1 │ name │
└───────┴─────────┴───────┴─────────┴───────┴─────────┘
this case return table.column_name;`
The text was updated successfully, but these errors were encountered: