如何在两个Mysql表之间查找缺失值 [英] How to Find Missing Value Between Two Mysql Tables
本文介绍了如何在两个Mysql表之间查找缺失值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
select userid from cw_users where NOT EXISTS(Select userid from cw_users_data)
上一个查询当然不会做.
The previous query won't do the job of course.
通过比较尝试从tableb中仅查找缺少的用户ID".
Trying to find only a missing 'userid' from tableb by doing a comparison.
两个表都包含"userid",并且每个表上应该有一个相似的表.我正在尝试查找第二张桌子上缺少的那个.
Both tables contain 'userid' and there should be one similar on each. I'm trying to find which one is missing on second table.
推荐答案
select userid from cw_users where userid not in(select userid from cw_users_data)
这篇关于如何在两个Mysql表之间查找缺失值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文