[
https://issues.apache.org/jira/browse/CALCITE-5749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17730319#comment-17730319
]
Julian Hyde commented on CALCITE-5749:
--------------------------------------
I'm not sure what the correct behavior is. It probably should be no worse than
using the same table twice, e.g.
{code}
select * from emp, emp;
{code}
If two tables have the same table alias, is it an error to use it? In other
words, are the following queries valid?
{code}
select emp.deptno from emp, emp;
select emp.deptno from emp, dept as emp;
{code}
> Join table with different database name and same table name will throw
> exception
> --------------------------------------------------------------------------------
>
> Key: CALCITE-5749
> URL: https://issues.apache.org/jira/browse/CALCITE-5749
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.34.0
> Reporter: xiong duan
> Assignee: xiong duan
> Priority: Major
>
> When we execute SQL:
> {code:java}
> select * from test1.tablea,test2.tablea {code}
> Calcite will throw exception:
> {code:java}
> Duplicate relation name 'tablea' in FROM clause {code}
> Because when we generate alias for this table, just use the last value in the
> names.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)