我有一个未正确设置的 MySQL 数据库。我需要一个查询来帮助我找出位置。
两张 table 表 1.xyz_ID 表2.xyz_ID
Table1.xyz_ID 中的某些条目在 Table2.xyz_ID 中没有对应的字段 什么 SQL 可以对错误的 Table2 条目进行排序?
最佳答案
select t1.xyz_ID
from Table1 t1
left join Table2 t2
on t1.xyz_ID = t2.xyz_ID
where t2.xyz_ID is null
提供所有在表1中但不在表2中的ID
关于mysql - SQL - 测试分贝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27120042/