查询两个表(表1,表2)这两个表有相同的ID
select * from 表1 a,表2 b where a.id<>b.id
select distinct aid from aaa where aid not in(select distinct a.aid from aaa a,bbb b where a.aid=b.aid)
select * from 表1 where id=intmyid Union select * from 表2 where id= intmyid
select * from 表1 left join 表2 on 表1.id = 表2.id