mysql数据库中,比较2张表中某2条数据不一致的地方

2025-04-10 20:05:15
推荐回答(1个)
回答1:

select t1.*, t2.*
from 真实表 t1 full join 临时表 using (id) //using也可写成on t1.id=t2.id
where t1.f!=t2.f or (t1.f is null and t2.f is not null) or (t1.f is not null and t2.f is null)