加入收藏 | 设为首页 | 会员中心 | 我要投稿 核心网 (https://www.hxwgxz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长百科 > 正文

oracle10g – 如何使用“as”为oracle 10中的连接表设置别名

发布时间:2021-05-26 17:48:18 所属栏目:站长百科 来源:网络整理
导读:我写了这个,这是错误的语法,帮我修复它,我希望’T’是两个内连接的结果的别名. select T.id from table1 inner join table2 on table1.x = table2.y inner join table3 on table3.z = table1.w as T; 您无法直接命名连接的结果.一种选择是使用子查询: selec

我写了这个,这是错误的语法,帮我修复它,我希望’T’是两个内连接的结果的别名.

select T.id 
from table1 
  inner join table2 on table1.x = table2.y  
  inner join table3 on table3.z = table1.w as T;
您无法直接命名连接的结果.一种选择是使用子查询:
select T.id
from (
  select *
  from table1
  inner join table2 on table1.x = table2.y
  inner join table3 on table3.z = table1.w
) T

另一种选择是子查询因子分解:

with T as (
  select *
  from table1
  inner join table2 on table1.x = table2.y
  inner join table3 on table3.z = table1.w
)
select T.id
from T

(编辑:核心网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读