通过子查询进行外连接
我正在尝试在 Oracle 10g DB 中执行查询以连接两个子查询,如下所示:
SELECT * FROM(
select count(y), x from a group by y) t1
full join
(select count(z), x from b group by z) t2
on (t1.x = t2.x)
问题是输出显示 x 的两个不同列,如下所示:
y z x x1
-------------------------------------------
2 4 1 1
3 (null) 2 (null)
2 (null) 3 (null)
8 (null) 4 (null)
(null) 4 (null) 5
(null) 6 (null) 6
有人可以帮助我吗?提前致谢!
I'm trying to execute a query in an Oracle 10g DB to join two subqueries as it follows:
SELECT * FROM(
select count(y), x from a group by y) t1
full join
(select count(z), x from b group by z) t2
on (t1.x = t2.x)
The problem is that the output shows two different columns for x as it follows:
y z x x1
-------------------------------------------
2 4 1 1
3 (null) 2 (null)
2 (null) 3 (null)
8 (null) 4 (null)
(null) 4 (null) 5
(null) 6 (null) 6
Does anyone can help me? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑你想要的是:
I suspect that what you want is: