查找数据库的不同元素

求教:查找数据库的不同元素将两个不同数据库的两张不同表的字段值做对比,如果相同则不显示,否则显示出来例

求教:查找数据库的不同元素
将两个不同数据库的两张不同表的字段值做对比,如果相同则不显示,否则显示出来

例如数据库A的表t1的某字段有值1,2,4,5,数据库B的表t2的某字段有值1,2,3,4,5,6,7,8,9,10,处理后的结果应该显示3,6,7,8,9,10,请问该如何实现?

[解决办法]
select id, 'a' as memo from a where id not in (select id from b)
union all
select id, 'b' from b where id not in (select id from a)
[解决办法]
select t1, 'a表' as memo from a where t1 not in (select t1 from b)
union all
select t2 as t1 , 'b表' as memo from b where t2 not in (select t1 from a)