如何在PL/SQL中加入子查询?
我需要在oracle中加入子查询。这不起作用我收到连接操作的语法错误
select s1.key, s1.value, s2.value
from ((select key, value
from tbl
where id = 1) as s1
join
(select key, value
from tbl
where id = 2) as s2
on s1.contract = s2.contract);
i need to join subqueries in oracle. This does not work i get a syntax error for the join operation
select s1.key, s1.value, s2.value
from ((select key, value
from tbl
where id = 1) as s1
join
(select key, value
from tbl
where id = 2) as s2
on s1.contract = s2.contract);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该在内联视图中选择要加入的字段 (
contract
):You should select the field you are joining on (
contract
) in the inline views:你的括号太多了。
You had one too many sets of Parenthesis.
去掉最外面的括号。
Get rid of the outer most parenthesis.