如何使用“as”在oracle 10中为连接表设置别名
我写了这个,这是错误的语法,帮我修复它,我希望“T”成为两个内部联接结果的别名。
select T.id
from table1
inner join table2 on table1.x = table2.y
inner join table3 on table3.z = table1.w as T;
I wrote this, and it is wrong syntax, help me fix it, I want 'T' to be an alias of the result of the two inner joins.
select T.id
from table1
inner join table2 on table1.x = table2.y
inner join table3 on table3.z = table1.w as T;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不能使用别名来命名“整个”连接,但是,您可以在连接的各个表上放置别名:
在投影中,您必须使用表的别名,它定义了
id选择的code>列。
You cannot use aliases to name the "entire" join, you can, however, put aliases on individual tables of the join:
In the projection, you will have to use the alias of the table, which defines the
id
column you are going toselect
.您不能直接命名联接的结果。一种选择是使用子查询:
另一种选择是子查询分解:
You can't directly name the result of a join. One option is to use a subquery:
Another option is subquery factoring: