SQL Full Out Join在同一表的同一列上

SQL Full Out Join在同一表的同一列上,第1张

SQL Full Out Join在同一表的同一列上

您首先做错了事,然后尝试对其进行修复。那是行不通的。

您想加入的事物是

select * from stuff where grp = 'a'
select * from stuff where grp ='b'
。因此,加入这些:

select a.ID as a, b.ID as b from  (select * from stuff where grp = 'a') afull join  (select * from stuff where grp = 'b') bon b.id = a.id

SQL小提琴



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5649724.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存