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

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

发布时间:2021-05-25 02:48:45 所属栏目:站长百科 来源:网络整理
导读:我写了这个,这是错误的语法,帮我修复它,我但愿’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

(编辑:湖南网)

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

    热点阅读