MySQL全内连接
我
SELECT clientReport.id
FROM clientReport
LEFT JOIN report02 ON (report02.id = clientReport.id)
WHERE report02.id is null;
这样做相当于
SELECT clientReport.id
WHERE clientReport.rowNumber NOT EXISTS (
SELECT clientReport.rowNumber FROM report02, clientReport
WHERE report02.id=clientReport.id);
我需要一个完整的内部联接,以便在 report02 中也获得不匹配,而不仅仅是 clientReport。我该如何编写连接来做到这一点?
I have
SELECT clientReport.id
FROM clientReport
LEFT JOIN report02 ON (report02.id = clientReport.id)
WHERE report02.id is null;
that does the equivalent of
SELECT clientReport.id
WHERE clientReport.rowNumber NOT EXISTS (
SELECT clientReport.rowNumber FROM report02, clientReport
WHERE report02.id=clientReport.id);
I need, presumably, a full inner join to also get mismatches in report02, not just clientReport. How do I write the join to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面的应该可以工作。
它应该,但事实并非如此(因为 MySQL 目前不支持 FULL OUTER JOIN。)
这更有可能起作用:
The below should work.
It should but it doesn't (as MySQL does not currently support
FULL OUTER JOIN
.)This is more likely to work: