MySQL中计算多个表中的匹配值
我有 6 个供应商“库存”数据库,我已将它们与主数据库匹配/不匹配。如果在库存中找到了主数据中的唯一 ID,我们会将“匹配”一词放入我们创建的名为“状态”的列中。如果主站没有匹配的唯一 ID,我们会在“状态”列中输入“不匹配”。我们已经对每个供应商库存数据库执行了此操作。我想对具有“匹配”和“不匹配”的唯一 ID 的数量进行连续计数,以便快速浏览。
例如:
组合所有 6 个库存数据库的结果:
库存总量:20000 “比赛”总数:14000 “不匹配”总数:6000
I have 6 vendor "inventory" databases that I have matched/not matched to a master database. If a unique ID was found in the inventory that was also in the master, we put the word 'Match' in a column we created called Status. If the master did not have a matching unique ID, we put 'No Match' in the Status column. We have done this for each vendor inventory database. I want to keep a running count of the amount of unique ID's that have 'Match' and 'No Match' to look at for a quick glance.
For example:
Results that combine all 6 inventory databases:
Inventory total: 20000
'Match' total: 14000
'No Match' total: 6000
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能不是最好的方法,也没有经过测试,但这就是我想出的方法。
我不完全确定这是否是您所追求的,但我希望它有所帮助。
This may not be the best way, nor is it tested, but here's what I came up with.
I'm not entirely sure if that's what you're after or not, but i hope it helps.
这行得通吗?
Would this work?
如果我理解正确的话...
If I understand you correctly...